I have a system that runs a lot of cronjobs. It seems that one of these crons is consuming excessive amounts of CPU and memory on occasion.

Is there an easy way to audit CPU and memory usage of cron jobs?

link|improve this question

78% accept rate
feedback

4 Answers

Have you looked at sar/sadc?

link|improve this answer
feedback

No, not specifically, but that should not be necessary. Just use any of the common monitoring tools; most allow breaking down resource usage by process.

The simplest solution would be a script that regularly runs vmstat and top and appends results to a file (use top's "b" option). Or use a more sophisticated monitoring software, such as Nagios or ZenOSS (might be overkill for this problem, but they are generally useful). See e.g. http://serverfault.com/questions/83963/alternatives-to-nagios

link|improve this answer
feedback

This is a good idea for a new tool : ) some cron wrapper that does accounting

link|improve this answer
feedback

Have you considered launching the commands manually to audit them?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.