- Most Recent |
24 hours |
7 days |
30 days |
365 days |
aroedl 5 months ago Solution
It doesn’t help to just renice the process, because those processes are not very CPU-heavy and thus won’t be affected if you set them to a nice level of 19. What we need is a tool to set the I/O-niceness: ionice.
Just prepend the command you wish to run with ionice -c3. ionice is part of the util-linux package, that is installed by default on all newer Linux distributions.
Now you can go through your cron entries and prepend them with ionice -c3. This is the cron script for slocate (on Gentoo):
#! /bin/sh
if [ -x /usr/bin/updatedb ]
then
if [ -f /etc/updatedb.conf ]
then
ionice -c3 /usr/bin/updatedb
else
ionice -c3 /usr/bin/updatedb -f proc
fi
fi
Gentoo users could and should run emerge—sync or eix-sync like that:
ionice -c3 emerge --sync
ionice -c3 eix-sync
I’d even go so far and run all emerge commands with ionice, because it usually doesn’t really matter when exactly an emerge is finished. As a Gentoo expert, you know that you can set the CPU niceness with PORTAGE_NICENESS=”19” in your /etc/make.conf anyways.
From now on, you have another tool in your mental toolbox. Think twice if a simple nice is sufficient, because a lot of tasks are rather I/O than CPU heavy.
Don't forget to subscribe to our
RSS/Atom feed to get the latest tricks.









