mds_stores high CPU on Mac? Tell mds, mds_stores, mdworker_shared and corespotlightd apart before you fix anything
Frank Zhang
- 6 minutes read - 2889 wordsTL;DR
Those Spotlight names are not one process. Read the process list and the index switch first. Deleting an index folder is not the opening move.
Activity Monitor can show mds, mds_stores, mdworker_shared, and corespotlightd at the same time. They are not one process, and a hot Mac is not a reason to delete a Spotlight folder. mds is the metadata server: it serves clients of the metadata APIs, including Spotlight. mdworker is the worker mds uses to scan and index files when a volume is mounted or a file changes. Apple’s support article says indexing runs when you first set up the device, after a software update or upgrade, and as data on the device changes, and that it can take hours or even days depending on how much data there is. That article does not give a CPU percentage. Read which process is busy, and whether indexing is enabled, before you exclude a folder or rebuild anything.
The only incident written up on this site is the corespotlightd one. Those notes saw corespotlightd and mds. They did not record mds_stores or mdworker, they did not record a macOS version, and they did not record a CPU number after any delete. The short version is corespotlightd high CPU on Mac: read-only diagnosis before you delete anything. The longer notes from that day are in Chinese: corespotlightd CPU 高占用、Mac 发烫:先只读排查,别急着删库. Nothing below reuses that day’s 180%–200% reading as a line for other processes. Self-hosting is a different path: start here.
What each name is allowed to mean
“Busy” in this table is not a normal range. The manual pages and the support article do not publish one. When this page was written, mds(8) and mdworker(8) had pages. mds_stores, mdworker_shared, and corespotlightd did not.
| Process | What you can verify | While it is busy | Do not treat that as | Read-only command |
|---|---|---|---|---|
mds | mds(8): the metadata server. It serves all clients of the metadata APIs, including Spotlight. The page says not to run mds by hand. | The service is up. That is compatible with indexing. It is not a CPU target. | A damaged index, or a folder you should delete. | ps, top |
mds_stores | No manual page of its own. mdutil(1) is titled as the tool that manages the metadata stores used by Spotlight. The shared word is not a job description. | Record it separately from mds and from mdworker: whose CPU, whose memory. | Proof the index is being written into a bad state, or a reason to delete /.Spotlight-V100. | ps, top, log show |
mdworker and a process named mdworker_shared | mdworker(8): the worker mds uses to scan and index files as a volume is mounted or a file changes. The page does not mention the _shared suffix, and it says not to run mdworker by hand. | A volume was just mounted, or a lot of files just changed. How long that may last is not in the page. | A required number of worker processes, or a reason to kill one. Filter fs_usage on the name ps actually printed. | ps; fs_usage; mdimport -L lists importers only |
corespotlightd | Core Spotlight is the framework apps use to put their own content into an on-device index. Those indexes stay on the device, are private, and are not shared with Apple or synced to the person’s other devices. The pages linked here do not define a daemon named corespotlightd. | On this site, the process that sat with mds was corespotlightd. If that is the busy one again, use the two posts above, not the worker steps. | A reason to delete CoreDuet. The charging side effect of that delete is the Chinese post 删掉 CoreDuet 后,Mac 为什么突然不会省电了?. | ps, top; the detail is in those posts |
Importers are a separate layer. Apple’s archived importer troubleshooting page says /usr/bin/mdimport -L returns the importers the system currently recognizes, and their paths. The Core Spotlight documentation also says Spotlight File Import extensions do not provide that functionality on macOS; custom files go through a Spotlight importer plug-in. mdimport -L answers “which plug-ins are registered.” It does not answer “which plug-in is using the CPU.”
Read-only commands
None of these turn indexing off, erase a store, or rebuild one. They were not re-run on a Mac for this page. The flags are from the manual pages. If man on your Mac disagrees with a sentence below, your copy wins. The wording was read from the republication at keith.github.io/xcode-man-pages, not from a page on developer.apple.com.
1. Two samples, and only the second %CPU counts
top(1) says the first sample in logging mode shows an invalid %CPU for every process, because CPU is a delta between samples. Take two samples and read the second.
top -l 2 -n 20 -o cpu -stats pid,command,cpu,mem
-o cpu sorts by CPU usage, highest first. cpu is already the default sort key. -stats keeps those columns; mem is the physical memory footprint. -n 20 caps each sample at 20 processes so both samples print before top exits.
A pipeline you will also see is:
top -l 2 -o cpu -stats pid,command,cpu,mem | head -30
head -30 keeps the first 30 lines. That can cut off sample two, which is the sample with a real %CPU. The command above adds -n 20 and drops head for that reason. top does not change the index.
2. Is it there, and how long has it been running?
From ps(1): -a skips processes with no controlling terminal unless -x is also set. These daemons usually have no controlling terminal, so use both. pcpu is percentage CPU, rss is resident set size in 1024-byte units, etime is elapsed running time, and comm is the command name rather than the command plus arguments.
ps -axo pid,pcpu,rss,etime,comm | grep -Ei 'mds|mdworker|corespotlight'
The pattern is a substring. Read comm on each hit. The letters mds do not make two rows the same process. The pattern is also in grep’s own command line, so grep prints a row for itself. The bracket form used in the earlier notes hides that row:
ps -axo pid,pcpu,rss,etime,comm | grep -Ei '[m]ds|[m]dworker|[c]orespotlight'
rss and top’s mem are different columns. Do not add them. A long etime means the process is still there. Apple’s “hours or even days” already covers a long run, so elapsed time is not evidence of damage.
3. Indexing status, per volume
mdutil(1) manages the metadata stores used by Spotlight. -s displays indexing status. -a applies the command to all stores on all volumes. This command has -s and -a only. It does not include -E or -i.
mdutil -sa
Query only. In the earlier notes, mdutil -s / printed Indexing enabled for hours. Those words mean the index for that volume is switched on. They do not say how far a scan has gone, and they do not say it has finished. -sa can print more than one line. Each line is its own status. This page does not invent a catalogue of every status string; read the ones your terminal prints.
4. Which paths a worker is touching
fs_usage(1) shows an ongoing trace of system calls related to filesystem activity. It requires root because it uses kernel tracing. -w forces a wider listing. -f filesys keeps filesystem-related events. A command name at the end limits the sample to processes with that name. The manual’s own example is fs_usage -w -f filesys Mail.
Use the name from step 2. If the row says mdworker_shared, filter on that. If it says mdworker, change the filter:
sudo fs_usage -w -f filesys mdworker_shared | head -50
It keeps printing until the pipe closes or you press Ctrl-C. head -50 is there to stop after 50 lines; if it does not stop, press Ctrl-C. The manual also has -t seconds, which ends the run on its own. Pathnames are trimmed. The page describes the pathname column as the file accessed, up to the last 28 bytes, and says paths are trimmed from the left unless you pass -F. A short fragment is not a directory to delete. The earlier corespotlightd notes already said fs_usage is dense, uses CPU itself, and was not retested. Do not leave it running for hours on a machine that is already hot.
5. Logs already on disk
log show reads the system log datastore. It does not change Spotlight. --last 10m is ten minutes relative to the end of that log, --style compact is the compact format, and a predicate of the form process == "..." is what the log(1) examples use.
log show --last 10m --predicate 'process == "mds_stores"' --style compact | tail -50
Without --info or --debug, the output is default-level messages only. An empty result does not mean the process was idle. tail only shortens what you see; the query is still ten minutes. If the command cannot read the log, sudo is permission to read, the same limit as in the earlier notes. It does not repair the index. Swap in the process name ps printed.
6. Optional: which importers are registered
Keep -L if you only want the list:
mdimport -L
mdimport(1) says that when no switch is given, -i is implied: Spotlight imports the file or directory and stores the attributes in the index. Do not drop -L and point mdimport at a folder. That writes to the index. The republished page used here stops after -d, so the option list shows the letter L and then ends. That -L lists importers and paths is from Apple’s importer page, not only from that letter.
Wait, or go looking for a directory
Stay in this order.
- You just set the Mac up, you just installed a software update or upgrade, or data is changing: a new app that allows its content to be indexed, or new email or messages. That is Apple’s list of when indexing happens. mdworker(8) adds another pair of occasions: a volume was mounted, or files changed. Leave the Mac on power, and leave it idle when you can. Apple also says indexing finishes sooner if mail or other data has to be downloaded first and the Mac is on Wi-Fi or Ethernet. Press Command–Space. An indexing progress indicator may appear at the top of the Spotlight or Siri window. If you see it, that is the “indexing in progress” state the support article describes. If you do not see it, that does not prove indexing has stopped.
- If it stays busy and there is no progress indicator, use
fs_usageand see whether one path keeps coming back. A repeated path is a candidate, not a finished diagnosis. The places worth checking first are the ones that change all the time: dependency folders such asnode_modules, build output, virtual-machine disk images, sync folders, and external disks. That is a checklist. It is not a measurement recorded on this site. - If the busy process is
corespotlightd, stop using this page and use the two posts linked above. That incident’s log was full of CoreDuet lines. Deleting CoreDuet is not the next step formds_stores. - Do not
pkilla short name to make the CPU drop. A broad kill that took the desktop down with it is written up in Chinese: 误输 pkill 后 Mac 桌面全乱了?真正被你误杀的是 loginwindow.
If you change anything, start with the smallest change
Each step below changes Spotlight. Do it only after the read-only pass, and only if you accept what it changes.
1. Leave a folder out of search
This is the change that does not erase a volume’s store. Apple’s Mac User Guide says: open System Settings, click Spotlight in the sidebar (you may need to scroll), click Search Privacy at the lower right, then add a folder or disk with the add button or by dragging it in.
The version menu on the page checked for this post listed macOS Sonoma 14, Sequoia 15, Tahoe 26, and macOS 27. This page did not open every version. The indexing article gives the other labels you may see: Spotlight or Siri & Spotlight in the sidebar, and Search Privacy or Spotlight Privacy on the button. No current Apple page checked here still documents the older System Preferences click path. If the labels on your Mac do not match, search System Settings for Spotlight.
Two limits from the user guide belong with that step. If you exclude a Time Machine backup disk, you continue to receive messages that Spotlight is indexing it. That indexing is necessary for Time Machine and cannot be turned off. Search still excludes items on the backup disk that are not part of a Time Machine backup. If you exclude some files and folders, you may not be notified when updates become available for some apps. If you exclude the entire internal disk, you will not be notified about any updates.
Leaving an entry in the list excludes it from search. Removing an entry is how the user guide puts those files back into search. That is not the same sentence as a rebuild. The indexing article rebuild is: add the disk or folder, wait a few seconds, then remove it. Spotlight then reindexes that disk or folder. Use it when search results are wrong. It is a poor way to make CPU drop, because indexing runs again.
2. An external volume you do not need indexed
After you have read the volume name:
sudo mdutil -i off "/Volumes/Volume Name"
-i off sets indexing status for that volume to off. The same paragraph says indexing may be delayed by low disk space or other conditions. That sentence is about indexing being delayed. It is not a measured delay before -i off takes effect. Use the name mdutil -sa printed, and quote it if it contains spaces. Macintosh HD is an example name in Apple’s article, not a name your disk is required to have.
This changes indexing. It is not a diagnostic. The manual page does not say sudo is required; it is here because the command changes system state. If it is refused, stop. A permission failure is not an index finding. The matching on switch is -i on. Do not substitute -d. In the same manual, -d disables Spotlight searches on that volume. That is a different flag.
3. Erase this volume’s local store only when you mean to rebuild
After you accept incomplete search until the rebuild finishes, and a machine that may get busier during it:
sudo mdutil -E /
The manual says this flag erases each local store for the volumes indicated, and that the stores will be rebuilt if appropriate. It applies to the volume you name. Read mdutil -sa before you decide that the volume is /.
The earlier notes ran sudo mdutil -E / before they had read the status. What they recorded: user files stayed, search was incomplete until the rebuild finished, CPU could go up during the rebuild instead of down, nothing puts the old index back, and running -E again only erases it again. They did not time the rebuild, and they did not record the CPU when it finished. This page does not add a duration.
Do not delete /.Spotlight-V100
Do not run sudo rm -rf /.Spotlight-V100, and do not hand-delete a Spotlight directory you guessed.
The earlier notes never used that command, and they never checked that /.Spotlight-V100 was the live index on that Mac. A raw rm -rf does not go through mdutil. A wrong path, especially one that starts at /, deletes something else. The rebuild you would be trying to force is already mdutil -E: erase the local store, and rebuild it if appropriate. rm is not required for that, and it has no step that brings the old store back.
Do not delete CoreDuet to quiet mds_stores or mdworker_shared, and do not disable mds as a first look. Both change a different layer of state. That record is the corespotlightd posts.
What this page will not claim
- No target such as “down to some percent,” and no wait such as “give it some number of minutes.” Apple’s scale is hours or even days, depending on the data, with faster incremental updates after that. That sentence is from the support article. It is not a new clock.
- No claim that
mds_storesormdworker_sharedwas measured here. The only first-hand notes are thecorespotlightdposts, and those posts say they did not record these two processes. Indexing enabledis not a progress report. An emptylog showis not “it was idle.” The firsttopsample’s %CPU does not count. Anfs_usagepath may be trimmed.mds_stores,mdworker_shared, andcorespotlightdhad no manual page in the set checked here. A similar name is not a verified job.
Pages checked for this post
On your Mac, man mds, man mdworker, man mdutil, man mdimport, man fs_usage, man top, man log, and man ps outrank the republication.
- mds(8), mdworker(8), mdutil(1), mdimport(1)
- fs_usage(1), top(1), log(1), ps(1)
- About Spotlight indexing and search results on Apple devices (the page’s published date was August 25, 2026)
- Prevent Spotlight searches in specific folders or disks on Mac
- Core Spotlight
- Troubleshooting Spotlight Importers
If this post helps, you can sponsor the blog. This is voluntary personal support, not a charitable donation.