everyday mac tools

mds_stores using high CPU on a Mac: what it is doing and when to act

· 6 min read

mds_stores is part of Spotlight. When it sits at the top of Activity Monitor with the fans running, the Mac is building or updating its search index, and in most cases the right fix is to leave it plugged in and let it finish. It becomes a problem only when it runs hard for many hours with no obvious trigger, or comes back every day. Then the cause is usually one folder or drive that never stops changing, or an index that needs rebuilding.

What mds, mds_stores and mdworker are

Three process names appear together:

  • mds is the metadata server, the coordinator. It watches for file changes and decides what needs indexing.
  • mds_stores writes and maintains the index itself, the database that Spotlight, Finder search and Mail search all read.
  • mdworker, usually shown as mdworker_shared and often several at once, opens individual files and pulls out their text and details.

All three are Apple system processes. None of them is malware and none should be removed. One thing to know when reading the numbers: Activity Monitor counts CPU per core, so 100% means one core is busy, not the whole Mac.

When high CPU is normal

Expect a spell of heavy indexing:

  • after a macOS update or upgrade
  • after Migration Assistant, or a restore from a backup
  • the first time an external drive is connected
  • after copying, unzipping or downloading a large number of files, including a mail account fetching years of messages
  • after you rebuild the index yourself

To confirm that indexing is what you are seeing, press Command-Space and type a word. On most versions, Spotlight shows Indexing with a progress bar while it works. In Terminal, this reports whether indexing is enabled on the startup disk:

mdutil -s /

On a laptop, keep it on power and awake. Indexing stops when the Mac sleeps, so a MacBook that is closed every time it gets busy never finishes. A large disk with a lot of documents can take an hour or more.

Signs that it is stuck

  • It has run hard for most of a day, awake and plugged in, with nothing from the list above to explain it.
  • It returns every day at about the same level.
  • The Indexing bar is still showing a day later.
  • Searches still miss files after it goes quiet.

Find what it keeps reading

Terminal can show which files the workers are touching, live:

sudo fs_usage -w -f filesys mdworker_shared

Let it run for ten or twenty seconds, then press Control-C. If the same folder scrolls past again and again, that folder is your answer. The usual suspects are folders whose contents are rewritten constantly:

  • build output and dependency folders in software projects, where thousands of files change on every build
  • virtual machine disk images and other very large files that are modified all day
  • a folder that a sync or backup app keeps rewriting
  • a folder receiving large downloads in progress
  • an external drive that is connected only briefly, so its indexing never gets to finish

Fixes, in order

  1. Wait, if there is a trigger. Plug in, leave the Mac awake, and give it an evening.
  2. Restart. This clears a worker that is stuck on a single damaged file.
  3. Exclude the folder that keeps changing. Open System Settings, then Spotlight (Siri & Spotlight on Ventura and Sonoma), click Search Privacy at the bottom, and add the folder with the plus button. Its contents stop being indexed and stop appearing in searches. How to exclude a folder from a file search covers the trade-offs.
  4. Turn off indexing for one external drive you never search: sudo mdutil -i off /Volumes/DriveName.
  5. Rebuild the index if results are wrong or the indexer never settles: sudo mdutil -E /. Expect high CPU again while it rebuilds; that is the rebuild doing its work. Rebuild the Spotlight index on a Mac has the full procedure and the Settings route.
  6. Turn indexing off entirely, as a last resort, with sudo mdutil -a -i off. Spotlight, Finder search and search inside Mail and other apps all degrade, so read Search for files on a Mac with Spotlight indexing turned off before you do.

Two things not to do. Force quitting mds_stores in Activity Monitor achieves nothing: macOS starts it again within seconds and the work still has to be done. And do not delete the hidden index folder on a drive by hand. Use mdutil, which tells the indexer what you did.

Searching while the index is busy

While the index is incomplete, Spotlight and Finder searches miss files. For a file name, Terminal’s find reads the disk directly and does not depend on the index:

find ~ -iname "*invoice*"

It is slow, and it is complete.

A search app that keeps its own catalog avoids the wait altogether. Everywhere reads every file name on the Mac into one list and narrows it as you type. Measured on an older Intel Mac with six million files, first setup took 31 seconds, searching works before setup finishes, and it catches up after sleep in under half a second. Option-Space opens it over any app.

The honest limit: it searches names and paths, not the text inside documents. If you rely on finding a phrase inside a file, you still need Spotlight’s index to finish. Everywhere is a one-time purchase with a free day to try it.

If the heat or noise is the real complaint

Indexing is one of several things that can run a Mac hot. If mds_stores is not near the top of the CPU list when the fans come on, look elsewhere: Fan noise on a Mac goes through the other causes in order.

Questions

Is it safe to force quit mds_stores? It does no harm, and no good either. It relaunches straight away. If you want it to stop, exclude the folder it is working on or turn indexing off for that drive.

How long should indexing take? It depends on how many files there are and how many contain text to read. Minutes for a nearly empty Mac, hours for a full disk after a migration. A full day awake and on power with no progress is the point to start on the fixes above.

Does indexing drain the battery? While it is working, yes, like any heavy task. That is the reason to let a big index finish while the Mac is plugged in rather than fighting it on battery.

Why does it start again after every update? macOS updates often change how files are indexed, so the index is refreshed afterward. It is expected, and it ends.