Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

MDS and mdworker processes gone wild

Ever since I upgraded to Lion on my Macbook Pro I am getting intermittant periods where the MDS and MDWORKER processes completely take over the CPU and all apparent activity for minutes at a time. It's now been a week, so I'm quite sure Spotlight is done indexing the drive. What are my options?


User uploaded file

MacBook Pro 15" (early 2009)-OTHER, Mac OS X (10.7), 2.8GHz Core 2, 8GB RAM, 500GB HD

Posted on Jul 27, 2011 5:02 PM

Reply
43 replies

Aug 19, 2011 4:18 PM in response to Dino Ilarde

I have the new air, and was doing fine for about a month. Now all of a sudden the mdworker thing is happening to me, and I don't know why. Haven't changed anything but now it's driving my processor crazy. I've been doing time machine backups to a time capsule from the beginning. So, I don't get it. None of the explanations explain why this struck from the blue.

Sep 19, 2011 7:52 AM in response to adamhauck

since upgrading to lion, i have the same problem, that mdworker often slows down my iMac.


i DON'T have a TimeCapsule or a TimeMachine-Volume connected. there are no external drives running.


Console gives me this error to system.log:


Sep 19 16:47:18 iMac mdworker[3072]: (Normal) Import: Spotlight giving up on importing file after 240.001 seconds, (0 seconds in Spotlight importer plugin) - diagnostic:0 - find suspect file using: sudo mdutil -t 13979937

Sep 19 16:47:18 iMac com.apple.launchd.peruser.501[149] (com.apple.mdworker.pool.0[3072]): Exited with code: 75


does anybody know what this could mean?

i always have some harddrive-activity which i can hear - mdworker takes about 15% of CPU.


thanks, simon

Sep 30, 2011 6:07 AM in response to adamhauck

I've been trying to find why my MDS process was overpowering my system. It went through indexing when I upgraded to Lion a couple months ago and had been running fine until yesterday. I finally turned off bluetooth and went back to my wired keyboard and mouse, which reduced the problem but didn't eliminate it.


This morning I noticed I had internet activity when I had no internet programs running. After reading the comment above on BackBlaze, I went to spotlight preferences and added my DropBox folder to the privacy list. That seems to have reduced the problem. At least my trackpad isn't going as crazy as it was with random clicks and selections. Activity monitor is showing greatly reduced activity too.


I've had dropbox running for several months so I don't know why it would suddenly become a problem, and it is possible that taking it out of the spotlight indexing was an unrelated action, but for now I might be able to go back to my magic trackpad.

Oct 8, 2011 11:37 PM in response to adamhauck

I was having the same issue. But i seemed to have fixed it. All i did was run diskwarrior and esentialy de-frag my hd. I know there are many out there that say OSX does this for you and you dont need to do it but in my + years of experience with the mac I have found that it fixes soo many issues. Anyways I hope that helps.

Oct 21, 2011 10:20 AM in response to Ponkie

I found today that mdworker was going crazy trying to keep up with edits that I was making in Aperture! It was taking ~100% CPU on my 2011 15" MBP. I'm talking brushing adjustments here, not changes to metadata. It would go away, but then a few more brushes would trigger mdworker back to 100% again. I put my folder with the aperture libraries into Spotlights "exclude" list and mdworker disappeared from the CPU list in my Activity Monitor.

Oct 23, 2011 5:10 PM in response to adamhauck

I've to report the identical problem - on my 2009 Mac Pro, and my 2011 MacBook Pro.


Both using 10.7.2.


MDS/MDSWorker processes spike up and eat CPU time, which means more system head and (on the MBP) less battery life.


The spike goes down for a while, but later it goes back up.


Not seeing any change in network usage (yet), but these two processes hogging the system does add to rendering time... I'm hoping 10.7.3 will fix the issue.

Dec 28, 2011 6:50 PM in response to ilikeU

I've been having the "runaway mds / mdsworker crushes my machine" problem now and then for a couple weeks. No BackBlaze or similar, no remote Time Machine, just me and an impressively slowed Mac Pro. (10.7.2 installed over Snow Leopard). At times, Activity Monitor would update two or three times a minute.


Turns out /Volumes/Macintosh HD/.Spotlight-V100/Store-V2 had an absurd number of directories in it, clearly a runaway indexing process had gone crazy with mkdir(). I don't even know how many tens of thousands were in there. Touching that directory at all for any reason was slow.


After finding the broken directory, nuking the whole index, and restarting, life is good. If things break again I'll post an update.


Thanks for the pointer iLikeU, though I should point out I didn't find a /Volumes/.Spotlight-V100, but I did find /Volumes/*/.Spotlight-V100. I assume that's what you meant?


Dear devs: please have mds/mdworker sanity-check the number of entries in Store-Vn once in a while, thanks!

Dec 29, 2011 10:30 PM in response to Neo Phyte

Must not have been a one-time bug that made all those directories (in .Spotlight-V100-Store-V2/<some uid>/Cache/0000/0000), since they're growing again.


Dec 28 22:19:49 216-39-138-161 mdworker[30562]: (Normal) Import: Using too many resources after 26688 files (wired: 0 resident: 20311 swapped: 2 regions: 2020), hit usage threshold importing /Users/scott/Library/Mail/V2/Mailboxes/Junk (scott@valet).mbox/7BD6483D-4451-4119-B379-8E2E5C2E96B9/Data/2/4/6/3/Messages/3 642558.emlx, exiting to clean up now.


Ah-ha. (For some reason the Spotlight privacy chooser wouldn't show me /Users/scott/Library, had to drag it from a Finder window.) Put all my Junk folders in the privacy list. Who needs to index their spam?


Things have been smooth since then. So, to recap:


- look in system.log for mdworker errors, put suspect directories in the Spotlight privacy list (or just delete the problem files)

- nuke the Spotlight cache (sudo rm -rf /Volumes/[DISKNAME]/.Spotlight-V100)

- recreate an empty Spotlight index for mds to workwith (sudo mdutil -E /Volumes/[DISKNAME])


Thanks iLikeU!

Jan 12, 2012 7:29 PM in response to melwin

For me too! I already had my Time Machine disk, which is a Time Capsule, listed in my MacBook Air's Spotlight Privacy box, but recently, I moved my iTunes Library on an external disk connected to my Time Capsule. Excluding this "AirDisk" from the Spotlight index did the trick instantly. My CPU usage dropped like magic and fans quited down. I hope this can help someone, somehow.

MDS and mdworker processes gone wild

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.