[ltp] Problem with updatedb

Richard linux-thinkpad@linux-thinkpad.org
Fri, 22 Aug 2003 12:17:50 +0100 (BST)


On Thu, 21 Aug 2003, Ronald W. Heiby wrote:

> > This line that "renices" all processes might be what you want to modify,
> > rather than removing or halting the updatedb process.
>
> Looking at RH 8.0, the line before the updatedb invocation does not
> renice "all processes". It renices the current shell process (running
> the script). The effect is to REDUCE the priority given to that shell
> process AND ALL OF ITS CHILDREN so that the amount that they interfere
> with anything else going on in the system is minimized.
>
> Anyone who doesn't like the performance hit of running this script
> will NOT want to change it to run at a higher priority than it already
> is set to run.


I think that the root cause of the problem is this:
Renicing a process to 20 does indeed make sure that it doesn't use up CPU
time that wouldn't otherwise be simply wasted. The problem is that Linux
doesn't prioritise disk access. So, with fairly low CPU use, the
updatedb command can monopolise all the disk I/O - and therefore, other,
(higher priority) processes block, waiting for disk access.
(I think this is because CPU used to be the limiting factor in
system performance; whereas nowadays, it's usually disk/memory bandwidth)


1)Is there any way to "renice disk access"?

2)Your updatedb command should probably run at about 4am. That's the
normal configuration. But, if you have the machine switched off at that
time, the cron job will be missed. If you are also running anacron, then
a short while after you boot/resume the machine, it will run the cron jobs
that were omitted. You could always turn off anacron.

3)You definitely do want these cron jobs to run at least occasionally.
They do some useful maintenance on the system. If you have local mail
setup correctly, you'll get email from crond telling you what happened.

Best wishes

Richard