Platform Team/Server Kit/Guide/Usage Statistics: Difference between revisions

M anish (talk | contribs)
No edit summary
Line 10: Line 10:
==Factors affecting network bandwidth==
==Factors affecting network bandwidth==


The two primary factors affecting the network bandwidth are:
The only factor that really affects the network bandwidth usage is the resolution at which the data is being stored. Currently, the default step-size is 60 seconds.
* the size of the RRDs being synced
* and the sync frequency.


===RRD size===
==Factors affecting database size on the client side==
* This is primarily controlled through RRA (parameters). I will upload more notes on this as I get to know RRD's better. (Anish)


===Sync frequency===
The factor that affects the database size on the client is the RRAs (Round Robin Archives) being cached on the Client XO.
* This is controlled by the <tt>update-timeout</tt> parameter in the sugar-client configuration.


<span style="color: red;">'''Caution:''' The default RRD parameters and the sync frequency don't quite match up. The RRDs track usage statistics for around 8-10 days and the sync frequency is one hour! This needs to be tweaked appropriately while deploying in a production environment to save on bandwidth.</span>
The default RRA configuration on the client side reads something like
 
RRA:AVERAGE:0.5:1:4320
RRA:AVERAGE:0.5:5:2016
 
This means that there is one RRA (Round robin archive) within the DB that stores one value every minute for 4320 samples. This makes the total length of this 1 minute resolution RRA to be 4320 minutes = 3 days
 
The other RRA stores an average of 5 samples, for a total of 2016 samples. Thus its total duration is 5x2016 min= 10080 min= 7 days.
 
Thus the default duration of high resolution samples is 3 days and lower resolution samples is 7 days. Tweaking these values will affect both the database size on the client size and the network usage.
 
For locations with very intermittent connectivity, having bigger-duration databases might be advisable. sample RRA's could be
 
RRA:AVERAGE:0.5:1:43200 (30 days)
RRA:AVERAGE:0.5:5:20160 (70 days)
 
The above sample values will not be having any impact on network usage, since we're not increasing their resolution, frequency or adding/removing more RRA's