mds_stores and mdworker using a lot of CPU
Spotlight is reading your files to index them. Why it happens after an update or a big copy, how long it takes, and how to keep it out of folders.
The short answer
mds, mds_stores and mdworker are Spotlight, the search in the menu bar and Finder. They read new and changed files to index them. After a macOS update, moving to a new Mac or copying many files, they can be busy for hours. It stops by itself; you can keep Spotlight out of folders it has no need to search.
What each one does
- mds is Spotlight's server: it keeps the index and answers searches.
- mds_stores writes the index to disk.
- mdworker and mdworker_shared open files and read what is in them; there are often many at once.
Why it is busy now
- macOS was just updated, which often rebuilds the index;
- you moved to a new Mac, restored a backup or connected a new disk;
- many files changed at once: a big download, an unpacked archive, a project with thousands of files;
- a folder that keeps changing, such as a build output folder or
node_modules, makes it index the same files again and again.
How long it takes
From minutes after a small change to several hours after an update or a migration, longer on a full disk. It slows down while you use the Mac and catches up when the Mac is idle, so leaving the Mac on and plugged in overnight finishes it soonest.
What helps
- Let it finish once; the next updates are small.
- Keep Spotlight out of folders you never search, such as build folders, virtual machine disks and big data folders: in System Settings → Spotlight, click Search Privacy (on older macOS: Siri & Spotlight → Spotlight Privacy), then add the folder.
- If it never stops, or search finds nothing, rebuild the index: add your disk to that privacy list, wait a minute and remove it again. macOS indexes it from scratch.
Can I quit them?
Yes, it is safe: macOS starts them again, and they carry on where they left off. Quitting only pauses the work. Turning Spotlight off completely is possible from Terminal, but it also breaks search in Mail, Finder and other apps, so it is rarely worth it.