Wednesday 22 May 2019

Re: mlocate - what is it good for?

I not search things all the time, but when I do I use find-pipe-grep. Not because "locate" is an inferior solution, not at all, just a matter of habit.

On Wed, May 22, 2019 at 5:09 PM Andrea Corbellini <corbellini.andrea@gmail.com> wrote:
On Wed, May 22, 2019 at 8:47 PM Julian Andres Klode <julian.klode@canonical.com> wrote:
On Wed, May 22, 2019 at 01:19:48PM -0600, Neal McBurnett wrote:
> I use mlocate multiple times a day.
> Find is way too slow and inconvenient for finding files in a big
> set of filesystems, compared to properly configuring mlocate.

Specifically, the filesystem must be huge or on a slow medium. It might make
sense to move it out of standard and elsewhere, as I don't think it's
necessarily needed everywhere, such as laptops.

There's also the case of a blazing-fast medium, but high I/O load.
That's the case that I'm often facing when working on production servers. Using find there is very frustrating.

Consider my laptop, fairly standard, 512 GB NVME SSD, about 250G allocated,
containing about 1435134 files. mlocate foo takes 1s, find / -mount
-name '*foo*' takes about 7-9 secs, or 19 seconds with all mount points
(but there is a davfs mount of an internet server, so things might be
screwed up a bit).

19s to find something is perfectly workable, also you don't usually
find from /, but you have an idea where things are, so it will be much
faster.

19s for my standards are a lot, especially if I have to do multiple searches.
There have been cases where I dumped the output of "find /" into a file and resorted to search using grep.
 

I think mlocate only really makes sense on data storage servers with
huge disks, or on machines with HDDs. I therefore do not think the
overhead of building the index is warranted for most users. It might
make sense to keep mlocate in always-on tasks, like servers, but get
rid of it from desktop scenarios.
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


--
Marcos H. Alano
Linux System Administrator
marcoshalano@gmail.com