Friday, 24 May 2019

Re: mlocate - what is it good for?

On Thu, May 23, 2019 at 03:13:49PM -0400, Little Girl wrote:
> Hey there,

> Steve Langasek wrote:

> >I don't think the benefit of having locate available by default
> >justifies the daily disk thrashing / energy usage on every Ubuntu
> >machine everywhere.

> Just curious, but how bad (or excessive or whatever) is this disk
> thrashing / energy usage that you mentioned?

It is difficult to answer this in aggregate because the data is hard to come
by, and it definitely varies by type of disk and by number of files on the
system. You can get a sense of the effect on your own system by running
e.g. 'sudo iostat /dev/sda 30' in one window and 'sudo
/etc/cron.daily/mlocate' in another. On my otherwise-idle desktop with an
SSD, that only takes 3 seconds to complete and it only reads a few hundred
MB of data off the disk (in order to open every directory and stat every

I only have about 1.5 million files on my disk.

On machines with a lot more files; or machines with spinning disks instead
of SSDs; or heavily loaded servers, the impact is bound to be much higher
that 3 seconds of I/O.

And in a cloud environment running many Ubuntu instances on top of the same
storage set, the fact that this job is kicked off by cron simultaneously on
all instances can have a much more noticeable impact on server performance.
(Indeed, the daily cron jobs causing noticeable I/O storms is precisely what
led us to examine what cron jobs we have and question their utility.)

Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer