[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proposal: plocate as standard for bookworm



On Sun, Feb 07, 2021 at 12:40:55AM +0000, Paul Wise wrote:
> I support having locate in the base install, but I don't think that
> the cost of daily walking the entire filesystem is low; especially
> with HDDs and older storage or computers that can be a lot of I/O. I
> guess it also alters the Linux kernel block/filesystem caches?

updatedb.plocate, like updatedb.mlocate, doesn't actually watch the entire
filesystem. It keeps track of the mtime of each directory, and doesn't do the
readdir()/getdents() if it hasn't changed. So you get the cost of stat-ing
every directory, but that's actually fairly low.

On my server, with ~12M files on rotating media, updatedb.plocate finishes in
~40 seconds, IIRC. (I'd re-check to be sure, but today is RAID Sunday... :-) ) 
On my laptop with 875k files and a regular SSD, it's less than three. It does
alter the filesystem cache somewhat, but the amount of RAM used can be
bounded cgroups if desired; it runs from a systemd service.

/* Steinar */
-- 
Homepage: https://www.sesse.net/


Reply to: