User:Polvi/Spectator:Server Side Interaction: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 3: Line 3:
Lucky for us, the server controls how often data is uploaded, how much data, and on what interval.  
Lucky for us, the server controls how often data is uploaded, how much data, and on what interval.  


= How to stop the extension completely =
= Client/Server interaction =
When Spectator uploads data, it looks at the response code and txt to determine what to do next. By controlling the response, it is possible to fully control how Spectator behaves.
 
* How Spectator handles HTTP response statuses: [http://mxr.mozilla.org/seamonkey/source/extensions/metrics/src/nsMetricsService.cpp#667 here]
 
= Rate Limiting via the Spectator Config =
Spectator is configured via an XML config file which is provided as a response to uploading.
 
There are two limits; time and events. For example, one could set a limit of 200 events over 300 seconds. This give complete control of how much data could potentially be uploaded.
 
Note:
* If no config is in the response of a client upload, the client will continue with its old config.
 
= How to limit the number of active clients =
It is possible to control the number of active users if needed. Consider that only 1000 clients are desired, but there are 5000 active. In order to reduce the number of active users, the server would need to respond to 4000 requests with an empty <collectors/> element (see below). Once 4000 users are no longer collecting, no longer respond with a config at all. If no config is received in the response, the client will simply carry on as previously configured.
 
= How to stop the extension from uploading =
In order to completely turn off Spectator client side, and thus cause it to stop uploading, respond to client requests with the following config:
In order to completely turn off Spectator client side, and thus cause it to stop uploading, respond to client requests with the following config:


Line 9: Line 25:
   <config>
   <config>
     <collectors/>
     <collectors/>
    <upload interval="300"/>
   </config>
   </config>
  </response>
  </response>
If the DDOS does not stop, increase the upload interval.


= How to temporarily disable uploading =
= How to temporarily disable uploading =
In the event we need to keep the client from uploading, but not have it clear all the data it has collected, the server needs to respond with a 5xx server message.  
In the event we need to keep the client from uploading, but not have it clear all the data it has collected, the server needs to respond with a 5xx server message.  


[http://mxr.mozilla.org/seamonkey/source/extensions/metrics/src/nsMetricsService.cpp#667 Outline of server/extension interaction]
= How much data to expect =
Configured with profile, document, and uielement collectors, each post will be about 500 bytes. The files are uploaded on a 5min interval. So, if we had a 10,000 users using non-stop all day (very unlikely), we would be generating a max of 1.3gb (500*10000*(86400 / 300.))/(1024*1024*1024) of data a day.


= How much data to expect =
With typical usage, daily data collection would be roughly as follows:
Configured with profile, document, and uielement collectors, each post will be about 500 bytes. The files are uploaded on a 5min interval. So, if we had a 10,000 users using non-stop, we would be generating a max of 1.3gb (500*10000*(86400 / 300.))/(1024*1024*1024) of data a day. 


= Other considerations =
* 100 clients: 7mb
* If no config is in the response of a client upload, the client will continue with its old config.
* 1000 clients: 68mb
* Disabling a sample would be one way to reduce server load, without turning everything off
* 10000 clients: 680mb
334

edits

Navigation menu