High cpu/user load due to metrics/check parallelization execution


I’m facing to an issue that i don’t really know how to avoid it. On one of my server, i got multiples checks/metrics running like vmstat-metrics, load-metrics, metrics-net, disk-usage-metrics, disk-free. All of them works well.

Then i started to add script for checking the health of my application. Works perfect too.

And finally, i added a metrics script that compute and output few stats of the application, and put it back into graphite.

The last script, and all the metrics above are running every 60 seconds. But because it is running at the same time, my vmstat metrics show an high cpu-user %.

My understanding after investigation is because all the checks/metrics are executed at the same time, from now, vmstat-metrics will always get metrics when the application statistics script will execute as well.

In order to avoid this issue, i currently added sleep 10 in the application statistics script. That way, vmstat-metrics doesn’t see the high cpu user.

I was wondering if there is another way to delay script execution in time?