What is mdworker_shared?
mdworker_shared processes do the reading for Spotlight. Each one opens files, pulls out text and details (like the title of a document, or the size and date of a photo) and hands them to mds_stores to add to the index.
macOS starts several of them at once to get through big batches of files faster, so it's normal to see many mdworker_shared entries in Activity Monitor. They exit when there's nothing left to read.
Why is mdworker_shared using so much CPU?
- Lots of new or changed files, after a download, a sync, a backup restore or a macOS update.
- Large or complex files, like big PDFs or documents, which take longer to read.
- Folders that change constantly, so the same files are read again and again.
How to fix high mdworker_shared CPU usage
- Confirm it in Activity Monitor. Press ⌘ Space, type Activity Monitor, open the CPU tab and sort by % CPU. Watch
mdworker_sharedfor a minute: short spikes are normal, only steady high usage needs fixing. - Let them finish while plugged in. They stop on their own once Spotlight is caught up.
- Exclude folders you never search (build output, caches, virtual machines) in Spotlight's privacy list in System Settings.
- Check for a constantly changing folder. If they never stop, an app may be rewriting files nonstop; excluding that folder fixes it.
More help: How to check CPU usage on a Mac