Bug 114761 - Slow machine because of cron.daily and updatedb
Summary: Slow machine because of cron.daily and updatedb
Status: RESOLVED FIXED
: 93563 138551 196746 (view as bug list)
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Kernel (show other bugs)
Version: unspecified
Hardware: Other All
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Mads Martin Joergensen
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-01 16:00 UTC by Petr Mladek
Modified: 2006-08-03 13:37 UTC (History)
4 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Output from hwinfo on my machine (217.93 KB, text/plain)
2005-09-01 16:38 UTC, Petr Mladek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Mladek 2005-09-01 16:00:01 UTC
I investigated why my machine is so slow and found that the system is busy with
the command find started by /etc/cron.daily/suse.de-updatedb.

I am not sure if it is a common problem. Maybe, I see this problem as more
important because I build OpenOffice_org. There is used the disk a lot as well,
so the slowness might be more visible than for normal user.

It seems that the scripts in cron.daily are started immediatelly after the
system is installed. And they are started each day at the same time then. I
think that it would be better to postpone the first or the second start to the
midnight. It would be enough to touch /var/spool/cron/lastrun/cron.daily to a
reasonable value in a post install script.

I think that it looks curious when a fresh system is so slow after it is
installed. And it is so slow every day at the same ugly time.
Comment 1 Dr. Werner Fink 2005-09-01 16:06:09 UTC
Guess: Old IDE based system with slow IDE chip and disks.
Comment 2 Petr Mladek 2005-09-01 16:38:16 UTC
Created attachment 48490 [details]
Output from hwinfo on my machine

It is quite a new machine with SATA disk. Maybe the problem is that I build
OOo. The machine is under high load. The disk is big and full of small source
files...
Comment 3 Andreas Schwab 2005-09-02 13:09:39 UTC
This is a kernel problem. 
Comment 4 Hubert Mantel 2005-09-05 13:10:55 UTC
The kernel has no way improving the performance of the hardware. If the cron
jobs need to be set up differentely, it's not a kernel problem.
Comment 5 Ruediger Oertel 2005-09-05 21:38:41 UTC
andreas was probably talking about the io-scheduler and that one is a 
kernel problem 
 
about the cronjobs: cron is not my package, but anyway, I'll gladly 
take patches ... 
 
Comment 6 Forgotten User 1GBkbCnI0A 2005-09-09 07:14:36 UTC
What about reverting the patch from bug [#71017]?
I just found out, that the daily script runs at the random time (of day), when I 
finished installation. Maybe there was a chance, that cron.daily run twice a 
day, but to my mind only once (the first time), provided the clock does not 
jump.
With the rm lines in crontab for removing the lastrun-files there was at least a 
chance to have control over the time the cron file run.
Comment 7 Ruediger Oertel 2005-09-11 23:49:55 UTC
you still have the chance to influence these by touching 
these files with a set reference time 
 
Comment 8 Petr Mladek 2005-09-12 15:05:32 UTC
The best solution I found is to do not touch the files
/var/spool/cron/lastrun/cron.* with the exact time when the scripts are started.
They could be touched with a time of the same day but early after midnight. It
means that the next start is sheduled the next day/week/month after midnight. If
the machine is not runnig over night, the scripts will be started the requsted
day after the machine is started.

The prefered exact time could be set in /etc/sysconfig, so the users could
change it easily.  


The question is what to do if the user prefers starting the script, for example
at 6p.m. and the latest time stamp says that it should be started, for example
at 4p.m. In this case, I would differ between two situations:

1. The latest time stamp says that it should be started this day at 4p.pm. In
this case I would pospone start to the preferred time at 6p.m.

2. The latest time stamp says that it should have been started some days before.
 In this case we cannot risk and must start the script immediatelly. And touch
the time stamp with the actual date, so the script is not started later the same
day.

The only problem with the postponed start is when the user preferes the time,
for example 6p.m. andshe/he stops the machine each day at 5p.m. Then the script
cron.daily is started just every second day. But it should not happen often if
we define the default prefered day close after midnight.
Comment 9 Ruediger Oertel 2005-09-14 12:40:21 UTC
forward to 10.1 and assigning to cron maintainer  
Comment 10 Mads Martin Joergensen 2005-09-29 11:47:33 UTC
*** Bug 93563 has been marked as a duplicate of this bug. ***
Comment 11 Richard Bos 2005-09-29 18:12:10 UTC
 I think that it would have been better to mark this bug as duplicate of    
this 93563, as the latter comes at least closer to the solution suse has  
most likely in mind. 
  
Anyway the description in 93563 refers to:  
http://susewiki.org/index.php?title=Schedule_cron_daily that tells how to 
have cron.daily scheduled.  
Comment 12 Jan Engelhardt 2005-10-19 11:56:24 UTC
updatedb should consequently be run with `ionice`, so it does not interfere at all. Even nice 20 is "not enough", not even with normal workloads a lot less than building OOO.
Comment 13 Mads Martin Joergensen 2005-10-19 13:13:30 UTC
Did you look at 10.0?

    eval nice -n 19 ionice -c 3 /usr/bin/updatedb $PARAMS 2> /dev/null
Comment 14 Olaf Dabrunz 2005-12-01 03:29:03 UTC
updatedb was running with ionice on my system for quite a while now. While it
is an improvement, the system is still too sluggish to make normal working
possible. E.g. starting a new shell (in screen) repeatedly takes from 3 to 10
seconds (or even more). Opening a short file in vim is similarly slow.
Comment 15 Olaf Dabrunz 2005-12-01 03:59:46 UTC
... and package compile times are up by 60%.
Comment 16 Mads Martin Joergensen 2005-12-14 14:18:05 UTC
*** Bug 138551 has been marked as a duplicate of this bug. ***
Comment 17 Stefan Hundhammer 2005-12-14 14:22:48 UTC
Using ionice is one approach, but still I would very much prefer to run those cron jobs when nobody is working with the machine. Petr's suggestion from comment #8 makes very much sense to me.
Comment 18 Mads Martin Joergensen 2006-01-12 10:51:17 UTC
Fixed in STABLE. There's now sysconfig variables to control this. Thanks to Martin Lasarsch for doing this.
Comment 19 Klaus Singvogel 2006-08-03 13:37:07 UTC
*** Bug 196746 has been marked as a duplicate of this bug. ***