I want to run a script through cron with low I / O and CPU priorities. If I understood correctly (and I couldn’t), I could just add proc_nice(10); in my script to lower the priority of the CPU, but there is no PHP equivalent for I / O priority.
There seems to be an ionice shell command for this, but I'm a Linux idiot and I don't know what I'm doing. Would this be the right line for my cron file if I want to use both nice and ionice to lower the priority of the script?
0 * * * * /usr/bin/nice -n 10 /usr/bin/ionice -c 3 /path/php/bin/php /path/script.php
I got the -c3 here ("puts the process in the idle scheduling class"), and I'm not sure what I want.
Is it possible to use a PHP call to proc_nice() instead of this method?
EDIT: my cron script is not working using the above, so I definitely misunderstood something
source share