MDworker bogging Mac

Like Windows, the Mac has lots of processes running. My current nemesis is something called mdworker which stands for metadata worker. That means nothing to me. But, apparently, this is the process that indexes files for Spotlight. So you can get it to go crazy after bad shutdowns where the Spotlight data indexes are screwed up. It should spike a little, but mine is constantly running at 50-80% of CPU (for a dual core that is alot!) and disk activity is crazy.

100% CPU use on One Core Process mdworker – Mac Forums
I’ve been getting serious CPU spikes with a process called mdworker. Seemingly randomly, it will start using 100% of one core on my Macbook Pro 2.4ghz. This is on OS 10.5.1.


As a fix,http://www.macintouch.com/tiger12.html suggests stopping mdworker, deleting all the indexes and reindexing everything to get it to normal. Mac OS X 10.4 Tiger (Part 12)
1) Using the mdutil command-line utility in Terminal, turn off indexing for each of your drives. example:

  $ sudo mdutil -i off /Volumes/your_hard_drive_name_1
  $ sudo mdutil -i off /Volumes/your_hard_drive_name_2

2) Then use mdutil to remove the indexes from each drive

  $ sudo mdutil -E /Volumes/your_hard_drive_name_1
  $ sudo mdutil -E /Volumes/your_hard_drive_name_2

3) Physically remove the .Spotlight directories from the root of each drive.

  $ cd /
  $ sudo rm -fr .Spotlight-V100

(do the same for your second or third drive) BE CAREFUL WITH THAT RM COMMAND! One typo could ruin your day.

4) Use mdutil again to turn indexing back on for each drive

  $ sudo mdutil -i on /Volumes/your_hard_drive_name_1
  $ sudo mdutil -i on /Volumes/your_hard_drive_name_2

5) Spotlight will now re-index all drives and should behave in a normal fashion. (No longer uses 60%-80% of your CPU)

Comments are closed.