`mds_stores` jump very high for a while [duplicate]

mds and mds_stores are constant CPU consumers even when I think nothing should have changed on the hard drive.

Activity Monitor:

activity monitor

I have a circa 2009 Macbook Pro with lots of software installed over the years. Dropbox and Crashplan are active background processes among many others.

I have included many locations in the privacy settings of Spotlight to exclude from its index:

  • USB drive
  • Crashplan folder
  • /Library/Caches
  • /Users/me/Library/Caches

Still, mds and mds_stores are constant consumers of CPU hovering around 10-12% each. My fan keeps running due to the heat.

Any ideas as to what it could be due and how I can troubleshoot?


As you know, the mds and mds_stores are Spotlight activities.

The reason why your Spotlight is so active could be a number of things; it could be you have an app or multiple apps constantly changing some folder contents.

First let's check whether Spotlight is the cause of the fans running so much. To test this, run the following in your terminal:

sudo mdutil -a -i off

this turns off indexing of files, and should result in a clear slow down of the fans if mds and/or mds_stores are to blame.

To turn indexing back on, run

sudo mdutil -a -i on

After this you could run the complete re-indexing of your hard drive (be aware this could be an over night job), it will delete your Spotlight data base forcing it to start over.

sudo rm -rf /.Spotlight-V100/*

The next and final step would be to add others to your (do not scan), privacy settings.


It's best to find high-volume directories and omit them from indexing using Spotlight->Privacy settings.

  1. In terminal call fs_usage to list files being indexed by mds_stores

    ~ sudo fs_usage -w -f filesys mds_stores

    0.000227 W Google Chrome He.789992
    12:13:46.660891    WrData[S]       D=0x03a7d92b  B=0x1000   /dev/disk1s1  /Users/XXX/Library/Caches/Google/Chrome/Default/Cache/73f8ce7b565cc7be_0                                                                        0.000297 W Google Chrome He.789992
    
  2. add those directories to the exclusion list in System Preferences → Spotlight → Privacy

If you have trouble it when mount external hard. check this article

Prevent Spotlight from indexing external drive

In my case, I solved it by creating .metadata_never_index file on the root path of external hard.

$ touch /Volumes/ExternalHard/.metadata_never_index

Hope it help someone.


Just to add a small tip on top of @Buscar웃 's correct answer: In my case, I realized that spotlight was actually indexing Time Machine backups (which is really a stupid thing to do in the first place). To me, this explains the constant CPU in the first place - TimeMachine creates an hourly backup, Spotlight tries to index it... After stopping the indexing service and removing existing indexes as indicated above, and before re-starting the indexing, I also excluded the TimeMachine volumes (open finder, go --> go to folder --> /Volumes, and then drag the TimeMachine volume to the exclude list of Spotlight). Fingers crossed.