I have discussed how to do basic configurations related to Stratos usage agent on separate post.If you need to aware more about basic configurations click here. Here in this post i will discuss how to use fine tune parameters for usage agent. As i discussed previous post usage agent is responsible for data publishing. Normally this publishing do after some data accumulation. based on applied load we may need to configure this publishing. Main cause for this configuration change is we saw some unusual CPU usage when we publish data. Because we fixed the number of records and Execution time.
Previous implementation of usage agent runs in 5 min intervals and this causes sudden CPU usage increases due to large number of records we are summarizing and persisting. To solve this issue, We use task which runs forever(until server shutdown) and persist small number of records in short intervals. Number of records and time interval can be configured via a configuration file.
The newly introduced configuration file should be copied into CARBON_HOME/repository/conf/advanced directory. configuration file should be named as usage-throttling-agent-config.xml. Default values for configuration options as follows.
- Startup delay - 60 seconds
- Execution interval - 100 milli seconds
- Records per execution - 100
If file is not available usage agent will use above default values.those values are tested optimized values for public deployment with 5000 active tenants. you will see following entries in usage-throttling-agent-config.xml file.
You can change values and analyze the results.See the following diagram for better understand of CPU Usage due to large number of records. These results may change due to the traffic to your servers and number of tenants.
Figure : Fixed time Publishing with more than 1 second delay VS Configured publishing with 100 milli second publish time and record limitation is 100