Package: mlocate
Version: 0.26-1
Severity: wishlist

Hello,

We have mlocate installed on quite a few of our VMs, and when cron.daily is
run on them, they all start at the same time. This can create a bit of I/O
all at once. I think that quite a few Debian installations are now VMs, and
so this situation is experienced by other people as well.

Would it be possible to have the daily morning job splayed over the course
of an hour or two so that the I/O is a bit more distributed?

This can be done in pure bash via:

        SPLAY=$((RANDOM % MAXWAIT))

Or using shuf(1) from the "coreutils" pakcage via:

        SPLAY=$(shuf -n 1 -i 1-${MAXWAIT})

Then the following would be run:

        [ -z "$SPLAY" ] || sleep $SPLAY

MAXWAIT could be defined in /etc/default/mlocate as (e.g.) 3600 (1 hour)
or 7200 (2 hours). 

Currently the cron script uses bash in the shebang, so $RANDOM is available,
but if was every change to plain-Bourne/dash, something else would be needed
(hence shuf(1)).

Regards,
David

-- System Information:
Debian Release: 8.9
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mlocate depends on:
ii  adduser  3.113+nmu3
ii  libc6    2.19-18+deb8u10

mlocate recommends no packages.

mlocate suggests no packages.

-- no debconf information

Reply via email to