[SOLVED] 'updatedb.mlocate' uses a lot of I/O bandwith

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Kyowash
Level 2
Level 2
Posts: 94
Joined: Mon Sep 25, 2017 1:22 pm
Location: /dev/full

[SOLVED] 'updatedb.mlocate' uses a lot of I/O bandwith

Post by Kyowash » Sat Apr 21, 2018 12:46 pm

Everyday a process called updatedb.mlocate uses almost 100% of the HDD during a period of time. Here's the output shown when checking it with iotop:

Code: Select all

Total DISK READ :       2.19 M/s | Total DISK WRITE :     333.87 K/s
Actual DISK READ:       2.19 M/s | Actual DISK WRITE:      78.56 K/s
  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND          
 2943 idle root        2.19 M/s  333.87 K/s  0.00 % 99.08 % updatedb.mlocate
It's pretty annoying because the system seems to take more time to do simple things like opening Xed or a virtual machine in VirtualBox while that command is running. I've found a solution to make it run weekly. However, I really don't know what's that command for. Here's what it does according to this site's post:
Updatedb is part of 'mlocate' which is simply an indexing system to keep a database listing all the files on your server that you can do searches from using the 'locate' command at the shell.
My question is: do I need this utility? When I have to find a file, I simply use find because I'm more familiar with it, and I don't think I'll ever use locate even if it's faster than find.
Last edited by Kyowash on Mon Apr 23, 2018 12:27 pm, edited 1 time in total.

User avatar
catweazel
Level 14
Level 14
Posts: 5469
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: 'updatedb.mlocate' uses a lot of I/O bandwith

Post by catweazel » Sat Apr 21, 2018 3:58 pm

Kyowash wrote:
Sat Apr 21, 2018 12:46 pm
My question is: do I need this utility? When I have to find a file, I simply use find because I'm more familiar with it, and I don't think I'll ever use locate even if it's faster than find.
If you don't use the locate command then you can disable it.

sudo dpkg -P mlocate
A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. - Max Planck

User avatar
Kyowash
Level 2
Level 2
Posts: 94
Joined: Mon Sep 25, 2017 1:22 pm
Location: /dev/full

Re: 'updatedb.mlocate' uses a lot of I/O bandwith

Post by Kyowash » Sun Apr 22, 2018 5:52 am

catweazel wrote:
Sat Apr 21, 2018 3:58 pm
Kyowash wrote:
Sat Apr 21, 2018 12:46 pm
My question is: do I need this utility? When I have to find a file, I simply use find because I'm more familiar with it, and I don't think I'll ever use locate even if it's faster than find.
If you don't use the locate command then you can disable it.

sudo dpkg -P mlocate
Okay, thank you for your help.
If I ever wanted to use locate it would be enough to install that package, right?

User avatar
catweazel
Level 14
Level 14
Posts: 5469
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: 'updatedb.mlocate' uses a lot of I/O bandwith

Post by catweazel » Sun Apr 22, 2018 6:02 am

Kyowash wrote:
Sun Apr 22, 2018 5:52 am
Okay, thank you for your help.
You're most welcome.
If I ever wanted to use locate it would be enough to install that package, right?
Yes.
A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. - Max Planck

lmuserx4849
Level 5
Level 5
Posts: 755
Joined: Wed Dec 17, 2014 2:55 am

Re: 'updatedb.mlocate' uses a lot of I/O bandwith

Post by lmuserx4849 » Sun Apr 22, 2018 11:17 am

Your issue piqued my interest. I use locate a lot because it indexes the "entire" system into a database. Sometimes after an install I'll run it. It should run in the background, unnoticed. find transverses the file system in real-time, and can be slower.

I found this: updatedb.mlocate uses 100% of the hdd IO. The OS is completely unusable.

It talks about PRUNEPATHS.

My contents of /etc/updatedb.conf:
PRUNE_BIND_MOUNTS="yes"
PRUNEPATHS="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /data /home/.ecryptfs"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ecryptfs fusesmb devtmpfs"

User avatar
Kyowash
Level 2
Level 2
Posts: 94
Joined: Mon Sep 25, 2017 1:22 pm
Location: /dev/full

Re: 'updatedb.mlocate' uses a lot of I/O bandwith

Post by Kyowash » Mon Apr 23, 2018 12:25 pm

lmuserx4849 wrote:
Sun Apr 22, 2018 11:17 am
Your issue piqued my interest. I use locate a lot because it indexes the "entire" system into a database. Sometimes after an install I'll run it. It should run in the background, unnoticed. find transverses the file system in real-time, and can be slower.

I found this: updatedb.mlocate uses 100% of the hdd IO. The OS is completely unusable.

It talks about PRUNEPATHS.

My contents of /etc/updatedb.conf:
PRUNE_BIND_MOUNTS="yes"
PRUNEPATHS="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /data /home/.ecryptfs"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ecryptfs fusesmb devtmpfs"
To be honest, three days ago I didn't know that locate existed, I discovered its existence because of the I/O bandwith the indexing used everyday. PRUNEPATHS is good to specify the directories desired to not be indexed, but the problem is that I don't like the system being indexed by a command I don't use. I understand you prefer to use locate, we all have our "ol' reliable", and mine is find. It's true it's slower, but I use find to find files not only by their name and to do things with them with -exec. As far as I'm aware, locate is not able to do so, so locate is not the appropriate utility for me. Which doesn't mean it's not for you or for anyone else.

Of course, there are more differences between find and locate. For those who are interested and, like me, didn't know about the existence of locate, here's a good comparison of them.

lmuserx4849
Level 5
Level 5
Posts: 755
Joined: Wed Dec 17, 2014 2:55 am

Re: 'updatedb.mlocate' uses a lot of I/O bandwith

Post by lmuserx4849 » Mon Apr 23, 2018 1:15 pm

Kyowash wrote:
Mon Apr 23, 2018 12:25 pm
lmuserx4849 wrote:
Sun Apr 22, 2018 11:17 am
Your issue piqued my interest. I use locate a lot because it indexes the "entire" system into a database. Sometimes after an install I'll run it. It should run in the background, unnoticed. find transverses the file system in real-time, and can be slower.

I found this: updatedb.mlocate uses 100% of the hdd IO. The OS is completely unusable.

It talks about PRUNEPATHS.

My contents of /etc/updatedb.conf:
PRUNE_BIND_MOUNTS="yes"
PRUNEPATHS="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /data /home/.ecryptfs"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ecryptfs fusesmb devtmpfs"
To be honest, three days ago I didn't know that locate existed, I discovered its existence because of the I/O bandwith the indexing used everyday. PRUNEPATHS is good to specify the directories desired to not be indexed, but the problem is that I don't like the system being indexed by a command I don't use. I understand you prefer to use locate, we all have our "ol' reliable", and mine is find. It's true it's slower, but I use find to find files not only by their name and to do things with them with -exec. As far as I'm aware, locate is not able to do so, so locate is not the appropriate utility for me. Which doesn't mean it's not for you or for anyone else.

Of course, there are more differences between find and locate. For those who are interested and, like me, didn't know about the existence of locate, here's a good comparison of them.
Linux is all about choice and learning. Just wanted to say there might be a reason for the i/o (prunepaths) and someone else reading the forum might find it helpful. :-) I know how you feel. I hate kde's meta data indexing, first thing I turn off, but someone else may love it.

User avatar
Kyowash
Level 2
Level 2
Posts: 94
Joined: Mon Sep 25, 2017 1:22 pm
Location: /dev/full

Re: 'updatedb.mlocate' uses a lot of I/O bandwith

Post by Kyowash » Mon Apr 23, 2018 4:24 pm

lmuserx4849 wrote:
Mon Apr 23, 2018 1:15 pm
Linux is all about choice and learning. Just wanted to say there might be a reason for the i/o (prunepaths) and someone else reading the forum might find it helpful. :-) I know how you feel. I hate kde's meta data indexing, first thing I turn off, but someone else may love it.
Don't worry, any comments will be highly appreciated. But I wanted to let you know why I wouldn't use locate.
The variety and freedom Linux offers is what makes it great. That's why for example beginners find it difficult to choose between too many distributions. But eventually everyone find the rightest choice for them, like I did with Mint and Cinnamon. :D
Speaking of KDE, I wonder what KDE users like yourself will do once Linux Mint 19 is released, as Mint 18.3 will be the last release to feature it.

Post Reply

Return to “Software & Applications”