I am running a CentOS 6 VPS with WHM/cPanel. I am trying to move some accounts, to reduce load, so I have to run /scripts/pkgacct, however the gzip and other processes run by this script cause a very high load on my server. I would like to keep load low as possible while still being able to complete this process.
2 Answers
You could set the nice and ionice value to a very high value. This won't lessen the load of the process but everything alse will always be prefered by the scheduler, resulting in a low performance loss.
-
If the command in question is already running, you can use
renice -p <PID> <PRIORITY>
andionice -c <CLASS> -p <PID>
to change their priorities. Oct 10, 2012 at 14:16
Why not use cPanel's build in load function? Just append this to your function:
/usr/local/cpanel/bin/cpuwatch
Example:
/usr/local/cpanel/bin/cpuwatch 3 /scripts/pkgacct acctName
This will run /scripts/pkgacct acctName
and pause the process when the CPU load reaches above 3. The process will resume when the CPU load is below 3. Run --help
on cpuwatch
for full help menu.