TransWikia.com

mds and mds_stores constantly consuming cpu

Ask Different Asked by jim70 on November 26, 2021

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?

15 Answers

I'm on Apple M1 and I don't have any external hard-drive connected. I have a folder on desktop which includes all my NodeJS projects. Since it is a working directory and lots of files and folders keep getting added/removed from it, I included it in the list for preventing spotlight from searching it:

Spotlight >> Privacy >> Prevent Spotlight from searching these locations

enter image description here

Good Luck...

Answered by Aakash on November 26, 2021

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.

Answered by Yeon-Gu on November 26, 2021

As other answers mentioned, Spotlight indexing is likely the cause of this issue. If you want to exclude folders or disks from being indexed using the UI, (as of macOS 10.15 Catalina) you can add them in System Preferences -> Spotlight -> Privacy

System Preferences dialog

Spotlight Privacy dialog

Answered by crobicha on November 26, 2021

This was driving me insane, Task Manager was recording 50-500mb/sec read operations while computer was idle, and I narrowed it down to MDS.

tldr; Summary steps:

  1. Add all folders (including hidden) under Macintosh HD to Spotlight exclusion.
  2. Remove Applications and Users folder, and anything else you need.

Here were my steps to diagnose this as the problem:

  1. Open Activity Monitor in stable-state, see massive read/sec. Verify MDS has read/written the most bytes.
  2. Open Spotlight in Settings
  3. Drag in "Macintosh HD" to exclusions
  4. Restart computer
  5. Open Activity Monitor
  6. Wait for steady-state, see read/sec down to <100kb (woohoo!).

Now the tricky part -- have to figure out what in "Macintosh Hd" is causing the issue and exclude.

  1. Re-open Spotlight Settings
  2. Clean up any exclusions that were noise in trying to figure this out, just leaving Macintosh HD and any others you know might be trouble-makers. For me I left: Shared, System, Unreal Engine, VirtualBox VMs
  3. Click "+" to add an exclusion, and go into Macintosh HD.
  4. IMPORTANT: Type cmd+shift+. to show hidden folders, which there should be many.
  5. Select all (cmd+a) then "Okay". Might get a couple of errors, which seems fine.
  6. Wait for steady-state and re-verify <100kb read/sec times.
  7. Remove "Macintosh HD" from the list with (-) button.
  8. Wait for steady-state and <100kb read/sec again. This took my computer ~2 minutes, presumably because it's indexing some of the folders which didn't make the exclusion list because of the errors. Press cmd+space to open spotlight, and enter some text like "a". Notice that right under the search bar, spotlight has a progress bar that says it's indexing even though it's only consuming <100kb/sec read (not consistent, sometimes takes 5 minutes to show up even after it starts). Not sure what's going on here, perhaps a bunch of very small files, but either way wait for it to finish. Once finished, it should go near almost 0 read/sec.
  9. Remove added folders one-by-one, repeating the process of waiting for both the progress bar and disk read/sec to go to zero. My removals in order were: Applications, Users, Volumes, .vol, bin, etc, cores, tmp, Unreal Engine, VirtualBox, opt, Shared, sbin, etcetera. Took about an hour per added folder to get back to <100kb/sec read. Enjoy!

Answered by pfrank on November 26, 2021

From what I know that number is not a 100% based usage, i.e. that 11.9 and 9.6 do not mean it takes up 11.9% and 9.6% of the whole CPU processing power.

For a dual core CPU, 10 in that column means it used up 10% of a core only, i.e. 5% of the whole CPU.

So for a 8 cores CPU, 100% usage of the whole CPU the number showed for a process should be 800 but not 100.

I assume your mac is a dual core CPU, 11.9 and 9.6 in total is not costing as much as you thought.

It should works the same way as top command works in Linux

Answered by tom10271 on November 26, 2021

When you close Spotlight by clicking outside it retains the text you entered in the text box. Deleting the text calmed the process down. My advice is to click/tap Esc two times when you're done with Spotlight. The first click clears the text box, the second one closes Spotlight.

Answered by Dimitar Nestorov on November 26, 2021

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

Answered by Anthony Metzidis on November 26, 2021

I had this problem and it persisted even after disabling spotlight search. ALthough I don’t have the pinterest extension mentioned above, I found that closing Firefox solved the issue.

Answered by John Shiva on November 26, 2021

if figured out when running the command sudo mdutil -a -i off that spotlight is trying to index a USB connected drive of one Terabyte. I disconnected it and restarted the computer.

Answered by Samsky on November 26, 2021

After trying everything there is on the web and forums, and nothing worked - a smart guy (Lincoln Adams) on the Apple forum with the same issue, made a mind blowing discovery: In his case (and mine, and maybe yours) - this was caused by the Pinterest button/extension in Firefox. Try closing Firefox, rebooting, and using another browser for a while. The thread on Apple forums

Answered by JRun on November 26, 2021

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.

Answered by JRun on November 26, 2021

I had this same issue. I went into Security & Privacy System Preference, just to look at what Spotlight was including. I checked one thing off and then back on again and it immediately stopped. Mine was using almost 100% CPU power and my fans were running nonstop. It all stopped after I did this and I have no idea why. I have a Mid 2012 MacBook Pro.

Answered by john on November 26, 2021

You said, "I have included many locations in the privacy settings of spotlight."
You need to include FEWER locations, not more. If you include more, that means Spotlight is keeping very busy looking at them all.
You can easily go to System Preferences/Spotlight to un-select many locations. Especially, un-select Mail, search engines, and other internet dependent options.
Shut down and restart after changing your Spotlight preferences.

Answered by Bob Dogg on November 26, 2021

I got the same issue, almost bought me a new mac. I checked all the stuff on the net about mds_stores etc... All I got was terminal programming and clean installation solutions.. without guarantees of fixing the problem.

So I checked my free-to-download cleaning and maintenance tool "Onyx" and in the navigation bar under maintenance you can check "Spotlight Rebuild" (as default is unchecked).

After that I had no problems and speed was up to normal. Also, Activity Monitor stays within normal parameters. I hope it stays that way and works. For it is an easy and free tip for non-technical Mac users.

Found that out an hour ago but looks promising. Goodluck

Answered by user108694 on November 26, 2021

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.

Answered by Ruskes on November 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP