3

Using Ubuntu Server an AWS micro box, so if the cpu utilization spikes AWS will virtually kill the CPU for the box (for about 30 sec).

nice doesn't solve the problem, but cpulimit does (I use it in my own cpu intensive cron jobs).

Some system default cron jobs are triggering the AWS cpu limiter.

There are about 15 default cron job scripts, rather than trying to re-write every one to use cpulimit, is there a way I can use cpulimit to limit the cpu of all cron jobs (that would have to include the sub processes that are spawned by the various scripts)?

David Parks
  • 2,516

2 Answers2

3

I realize this was originally asked in 2011, but nowadays you can achieve a similar result by altering cron.service to limit the CPU and I/O priority:

$ sudo systemctl edit cron.service
# edits go to /etc/systemd/system/cron.service.d/override.conf

By default, this also applies to subprocesses spawned by cron. I use something like this:

[Service]
Nice=19
CPUSchedulingPolicy=idle
IOSchedulingClass=idle
Nathaniel M. Beaver
  • 1,518
  • 12
  • 33
1

It looks like I found the answer to my question, great stuff here: a cpulimit daemon script that works box-wide.

http://ubuntuforums.org/showthread.php?t=992706

David Parks
  • 2,516