What Is mdworker_shared? Fixing High CPU on a Mac
Your fans spin up, the Mac feels warm, and Activity Monitor shows not one but several processes called mdworker_shared, some of them near the top of the CPU list. They have no icon, the name means nothing, and quitting one does not seem to help.
The short answer: mdworker_shared is the part of Spotlight that reads your files so they can be searched. It is busy after a macOS update, a migration or a large copy, and it settles on its own when indexing finishes. If it never settles, find the file it is stuck on and exclude that folder from Spotlight.
In almost every case it is doing exactly what it should. Here is what it is, why it gets busy, and what to do when it will not settle down.
What mdworker_shared actually does
Spotlight is built from three kinds of process, and it helps to know which is which:
mds, the metadata server. It decides what needs indexing and answers searches.mds_stores, which keeps the index itself on disk. We cover it in What Is mds_stores and Why Is It Using CPU?mdworker_shared, the workers. Apple's own manual page for the worker says it is used bymds"to scan and index files as a volume is mounted or a file changes."
On our test Mac, ps showed each one running under its own account:
| Process | What it does | Runs as |
|---|---|---|
mds |
Decides what to index, answers searches | root |
mds_stores |
Keeps the index on disk | _mds_stores |
mdworker_shared |
Reads files and extracts their text | You and _spotlight |
Content that lives inside apps rather than in files is indexed separately, by corespotlightd.
So when a file is created or changed, mds hands it to a worker. The worker opens the file, pulls out its name, dates, author and, for documents, the text inside, and passes that back to be stored in the index. That reading is the CPU you see.
Why there are several of them
The workers are started on demand and quit when they run out of work, so the number you see changes from minute to minute. They also run under different accounts. On our test Mac, running macOS 27.0.1, a check with ps showed one worker under the logged-in user and one under _spotlight, an account macOS uses for its own indexing. The first had been running for under two minutes and the second for 35 seconds.
You can see the same thing on your Mac in Terminal:
ps -axo user,pid,pcpu,etime,comm | grep mdworker
The first column is the account, the third is CPU, and the fourth is how long each worker has been alive.
Why it uses so much CPU
A worker is busy when there are many files to read. The common reasons:
- A new Mac or a migration. Every file arrives at once, and every one has to be read.
- A macOS update. Major updates often make Spotlight re-index.
- A large copy. Hundreds of gigabytes of photos, video or documents copied from a drive or downloaded from the cloud.
- A newly connected drive. Spotlight indexes external volumes too, unless you tell it not to.
- Folders with many thousands of small files, such as code dependencies, build output or a large mail archive, which change often and keep the workers coming back.
- A third-party importer. Apps can install their own Spotlight importers so their files become searchable. On our test Mac,
mdimport -Llisted 21 importers, three of them installed by apps: Transmit, LibreOffice and Blackmagic RAW. An importer that is slow or struggles with a particular file makes the worker reading it slow too.
The heat and fan noise that come with a big indexing run are normal. Our guide on why a Mac overheats explains what macOS does when temperatures climb.
Is mdworker_shared safe, or is it a virus?
It is not a virus. It is an Apple process, and the genuine one lives inside the system's Metadata framework:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mdworker_shared
The ps command above prints that full path in its last column. A process with this name running from anywhere else would be worth investigating.
Can you quit it?
It does not do much good. When we tried on macOS 27, an ordinary quit was ignored: the worker was still running five seconds later. A force quit ended it, but as soon as new files appeared, mds started three fresh workers within 15 seconds. Quitting removes one worker and leaves the cause in place, so the work simply starts again.
How to calm it down
Work through these in order. Most people never get past the first.
1. Give it time
If you have just updated macOS, migrated, or copied a lot of data, let it finish. Leave the Mac on and plugged in. A full index of a large drive can take hours, and once the queue is empty the workers quit on their own.
You can confirm indexing is switched on for your startup disk with:
mdutil -s /
It answers Indexing enabled. when everything is configured normally. It does not show progress.
2. Find the file it is stuck on
If one worker stays high for a long time, find out what it is reading.
- In Activity Monitor: double-click the busy
mdworker_shared, then open the Open Files and Ports tab. The file being indexed is usually in that list. This only works for a worker running under your own account. For one running under_spotlight, use the Terminal command below instead. - In Terminal: run the command below and watch the paths scroll past. Press Control-C to stop. It needs your administrator password, because it watches system-wide file activity.
sudo fs_usage -w -f filesys mdworker_shared
If the same file or folder keeps appearing, you have found your culprit.
3. Exclude folders Spotlight does not need
Build folders, virtual machine images, caches and large archives rarely need to be searchable. Excluding them stops the workers from reading them at all.
- If System Settings has a separate Spotlight pane (as on macOS 27): open System Settings > Spotlight, click Search Privacy…, then click + and choose the folder or disk.
- If it has Siri & Spotlight instead: the same list is under System Settings > Siri & Spotlight > Spotlight Privacy.
Be selective. macOS warns, when you add a location, that search will not work in some applications for anything inside it. Mail and Finder searches depend on the index.
4. Check third-party importers
Run mdimport -L to list every importer on your Mac. Anything outside /System/Library came with an app, and the path tells you which one. If the worker keeps stalling on one kind of file, update that app, or remove it if you no longer use it, which removes its importer too.
5. Rebuild the index if it has been stuck for days
If a worker has been pinned at high CPU for days and nothing above helped, the index may be damaged. You can erase and rebuild it:
sudo mdutil -E /
Expect the opposite of relief at first. Spotlight starts over, search results are incomplete for a while, and the workers are busy for hours while it rebuilds. Do this once, not as a routine.
What we would not do is turn Spotlight off entirely. It looks like a cure, but search in Finder, Mail and many apps depends on the index.
Frequently asked questions
What is mdworker_shared on a Mac?
mdworker_shared is a Spotlight worker process. When files are created or changed, the metadata server mds hands them to these workers, which read each file and extract its metadata and text so Spotlight can search it.
Is mdworker_shared a virus?
No. It is part of macOS and runs from inside the system's Metadata framework, the path shown in the section above. A process with that name running from anywhere else would be worth investigating.
Why are there so many mdworker_shared processes?
macOS starts workers on demand and they quit when they run out of work, so the count changes constantly. They also run under different accounts: your own for your files, and _spotlight for indexing macOS does itself.
Should I quit mdworker_shared?
It rarely helps. In our test on macOS 27 an ordinary quit was ignored, and after a force quit macOS started new workers within seconds as soon as files changed. Find the file or folder it is reading and exclude it from Spotlight instead.
How do I stop mdworker_shared using so much CPU?
Let indexing finish first. If it never settles, find the file it is reading with Activity Monitor's Open Files and Ports tab, exclude folders Spotlight does not need in Spotlight's Search Privacy settings, check third-party importers with mdimport -L, and as a last resort rebuild the index with sudo mdutil -E /.
See it in your menu bar
Activity Monitor tells you that mdworker_shared is busy. It does not tell you what it is or whether you should care.
MacStats is a menu bar monitor that keeps CPU, memory and the busiest processes one click away. The mdworker_shared workers that run under your own account appear in its Top CPU list, and with MacStats Pro, clicking one gives you a plain-English explanation of what it is doing and whether you need to act. Workers that macOS runs under its own _spotlight account are not listed yet.
macOS reports normal memory pressure.
↓8.03KB Live Activity
- 1MacStats16.4%›
- 2corespotlightd7.3%›
- 3Siri AI6.5%›
- 4dataaccessd2.3%›
- 1Google Chrome486.2 MB›
- 2Chrome Helper380 MB›
- 3OrbStack Helper373.6 MB›
- 4cmux296.7 MB›
MacBook Air, Apple M4 | 16 GB RAM | macOS 27.0
Catch a runaway process before the fans tell you.