1

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.

snowliondev
  • 23
  • 1
  • 5

2 Answers2

5

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.

Christopher Perrin
  • 4,811
  • 19
  • 33
  • If the command in question is already running, you can use `renice -p ` and `ionice -c -p ` to change their priorities. – Ladadadada Oct 10 '12 at 14:16
1

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.

Adam
  • 368
  • 3
  • 7