mds – what MDS process is and why it uses CPU on the Mac

Aug 5, 2010 - 47 Comments

mds mac
If your Mac is suddenly running sluggish and you launched Activity Monitor, you may notice a process named ‘mds’ cranking away at 30% and even up to 90% CPU utilization. If you see this, don’t worry, it’s not abnormal behavior and your Mac isn’t crashing, it’s just indexing it’s built in search engine.

What is MDS in Mac OS?

mds stands for “metadata server” and the mds process is part of Spotlight, the amazingly powerful and very useful search feature built directly into the foundation of Mac OS X. You access Spotlight by hitting Command+Spacebar.

An easy way to identify that mds and Spotlight is indexing is to look at the Spotlight icon in the upper right corner of your menubar, when Spotlight is indexing the magnifying glass will have a dot in the center like so:

mds update

You can then click on the Spotlight icon and you’ll see your main hard drive being indexed, with a progress bar and estimated time until completion:

mds updating

Is the mds process related to mdworker?

Yes. Usually you will see the mds process in conjunction with mdworker, which is another part of Spotlight and it’s indexing engine.

How long does mds & Spotlight take to finish indexing?

How long it takes to update the Spotlight index depends on a few variables, but mostly the size of your hard drive, the amount of data being indexed, major changes to the filesystem, and the time since last indexing. Just let the indexing complete, it generally takes between 15 and 45 minutes to complete.

If Spotlight isn’t working, you can check out these Spotlight troubleshooting tips which will get you situated again. If you don’t ever use the search feature or just don’t like it, you can also disable Spotlight and all of its indexing.

.

Related articles:

Posted by: Paul Horowitz in Mac OS, Troubleshooting

47 Comments

» Comments RSS Feed

  1. ron says:

    There sure are a lot of whiny reactions here! Spotlight is only a deamon running on your computer. If you don’t like it, turn it off. Three easy steps:

    1) Calm down and learn some computer basics, such as how to use the command line.

    2) Run the following command in your terminal:

    sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

    3) Get back to work.

    BTW: A basic rule of computing is to know how to undo (or rollback) anything you’ve done to your computer. Once you discover that Spotlight was useful and you want it back, simply run the following command. (Note the highly meaningful difference between “unload” and “load” in these two otherwise identical commands.

    sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

    • Jeffrey Fuller says:

      Well said.

      • Indy says:

        Hmmm… really? Not “well said”.
        Advice is well, but said in a moody (whiny?), know-it-all, curmudgeonly, manner.

      • Arf Root says:

        Good info, but condescending as hell. This tone is enforces the misanthropic sysadmin stereotype.

        Imagine going to your mechanic and him/her saying ‘Dude, calm down and learn something about dual clutch transmissions’. The reason you go to a mechanic is because you don’t know (and don’t want to know) those details.

        • mark says:

          Agreed. And Ron’s info isn’t even that great. There’s at least one other commenter reporting it doesn’t work.

          There’s a much easier way. Go to System Preferences -> Spotlight and uncheck all the categories boxes. That’s it. Easy to do and easy to reverse.

    • Tom Elliott says:

      “Operation not permitted while System Integrity Protection is engaged”

    • Hrothgar says:

      Steve Jobs: “It just works” tim cook: you’ll take what I sell you and love it or you can go to hell”

      Ron concurs. Pompous sys admin geek type!

    • mark says:

      What a jerk comment. And your information isn’t even that great.

      There’s a much easier way to disable indexing. Go to System Preferences -> Spotlight and deselect all of the categories listed for indexing.

      So much easier that having to memorize your command although not as pretentious.

    • mark says:

      What a jerk comment. And your information isn’t even that great.

      There’s a much easier way to disable indexing. Go to System Preferences -> Spotlight and deselect all of the categories listed for indexing.

      So much easier that having to memorize your command although not as pretentious.

      • Ron says:

        Yup, you are right on the money with that one, Mark. When I wrote that comment, I was spiritually, physically, and emotionally in a terrible place. There is no sob story to break out, but it was not a good way to go with offering advice. I originally came here with a lot of anger and, for an unrelated reason, decided to take it out here and chose to be a jerk.

        I apologize to the members of this community that I talked down to; I apologize to the people who read that and deflected from my tone. Most of all, I apologize for being condescending to all these folks just trying to fix their computer.

        I should not be so quick to push back with anger, judgment, or frustration, and I will try to carry more empathy as I work with others as we are all just doing the best that we can here.

  2. Ahmed T says:

    Eject your external harddrive and look it up again.

  3. Gary Vandeman says:

    I did not purchase a Mac so that it would tell me when I can work. I mistakenly believed that my Mac would work for me.

    Do not tell me that I am not as smart as Apple and that everything they do is “for my own benefit.”

    I found Time Machine Editor that lets me control when Time Machine runs.

    I need something similar for Spotlight.

    • Theron Ninth says:

      Can’t help U with Spotlight scheduler, but I did learn that, what with the seemingly global effort to strip icons & buttons & such down to absolute minimum of overhead (presumably for WiFi and TeethOfBlue) by removing animations and 3D effects, there is a new, non-animated “Backup In Progress” telltale–an itty-bitty 2ND triangle, at the 8:00 position on the clock, just below (obviously) the tiny triangle at 9:00. I had found that the animation was useful (clock hands/triangle going around, clockwise) to cue me into when backup was giving me a performance whack. The movement, of course, would catch your eye–whereas with the new, non-animated (static?) menubar icon, you only have a split 2nd to see the 2nd triangle “move”–from off to on.

      Unrelated, sort of: Can’t figure out how to reduce the # of flashes “on mouse up”–time was we could select 3, 2, 1 or none. I found that 1 flash was just fine, but two and three flashes were an annoyance.

  4. […] or by hitting the “-” minus button in the lower left. Removing items will trigger the mds and mdworker processes to run again, and when finished the once excluded files will be searchable […]

  5. […] an upgrade from 10.6, 10.7, or 10.8, this is usually because of Spotlight and the mdworker & mds process combination, which irons itself out over the course of an hour or so. If waiting it out […]

  6. […] reemphasize, this does not disable Spotlight or mds, it only hides the icon from the […]

  7. […] can also look in Activity Monitor for the “mds” or “mdworker” processes, both of which are related to […]

  8. George says:

    If you are using a using any P2P programs you may want to prevent Spotlight from searching your”incoming” directory. I discovered Spotlight was trying to index the partial files and was killing my performance. Once I added the directory to the list under System Preferences > Spotlight > Privacy my utilization went back down to normal.

  9. Andrew D. says:

    It’s a bit much to segue from a computer annoyance to a sweeping prediction of where Apple is going.

    If mds is going nuts evebn after reboot I would figure it is corruption somewhere. Perhaps reset the index to start from zero: http://support.apple.com/kb/HT2409?viewlocale=en_US&locale=en_US I am very sensitive to processes wasting power on my macbook (no laptoasters, thank you) and rarely have had a problem with mds or spotlight. The UI could use work though, like a lot of Apple stuff right now.

  10. Bill says:

    This is only 1 example of what MDS does. On my machine its running at 63% with a secondary mdworker running at 115% and my spotlight is not indicating anything of a rebuild.

    This is a major pain in the butt. This happens randomly almost everyday. Spotlight is a bloated piece of junk software that appears to be thrown together by a group of people being rushed. Is not clean, its not smooth, Its not even smart enough to ignore the contents of a program and lists pieces of graphic art for the UI’s and app note files that any normal day to day user would NEVER search for.

    Apple is falling apart, loosing its shine, as sloppy programmers, Ideas and programming are poorly implemented and handed out to Users.

  11. j says:

    BugsMan is a douchebag. Keep up the good work.

  12. Luke says:

    Thank you for writing this really nice, simple explanation of mds. It’s been running at 75% on my mac and I didn’t know if it was some process that was hanging that I should kill. I wish you could schedule it without needing to know Terminal language.

    And I agree that Spotlight is wonderful and more people should know about it, and so a little praise about it is a good thing. Too bad Bugsman didn’t agree. I’m glad we know his opinion and can change the world to fit his preferences.

    I drifted to Alfred from Spotlight, though, because it displays results with big text, in the middle of the screen. I like that!

    Luke

  13. Albert G says:

    I just started an initial time machine backup (on a new drive) and I noticed the mds and mdworker processes hitting the CPU in a big way.

    Does this mean that spotlight is now also indexing the backed-up files ?

    Albert

  14. […] in Mac OS X Lion can be done with the help of the Terminal. The following command unloads the Spotlight mds agent from launchd, preventing the daemon from running or indexing any drives […]

  15. Morialkar says:

    @Kono: do you restart your mac on a regular basic? this will probably clear the problem, as (I’m making a guess here) the process probably uses more RAM over time, in the same manner as Chrome or Firefox after 3 days and 10 tabs openned.

    • mrs running 3 days, sys slo says:

      My sys is hanging up for up to 30-60 seconds. AND I see that a root user process called mds is running using 99.8% CPU. AND there are 12 processes of mdworker among 2 users are using NO CPU%.

      This is supposed to be file indexing, that usually takes 45 minutes has been running for over 3 DAYS!!

      EVEN tho I have restarted computer twice during that 3 days.

      AND my Spotlight icon DOES NOT have a dot in the center.

      Can I force quit this process? Anychance it’s a virus masking as mds? I ran a MacKeeper scan just now and no files found.

      Should I do a disk utility repair disk permission?

      • Andre says:

        MacKeeper is causing your problem, uninstall MacKeeper. Do not install MacKeeper again, it does not help anything.

        Then reboot your Mac and LET IT SIT for several hours to complete the indexing.

        How do you think it’s going to index if you keep restarting it and turning it off?

  16. Kono says:

    my mds and mdworker is completely hogging my system and it has been going on for several week. I am suspecting that this is not a correct behavior. Does anyone know how to fix this permanently?

    Thanks,

  17. Mike says:

    My mds process is not hogging to the extent that you are describing but it is using a constant 254MB of virtual memory which is the top user on a periminant basis. Does that sound right? Is is a problem?

    Great article I have never noticed spotlight icon with a dot in the middle meaning that indexing is going on. Can you schedule it to happen when you decide not when the mac decides? “

  18. @Jeff

    sudo ln -s /dev/null /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds

    =)

    (For the sake of future Internet searchers finding this page: Just Kidding! Also -f flag left off intentionally. Whew!)

    -Rob

  19. Jeff says:

    The most important question, however, is “how do you shut down that stupid mds process that is taking up 2GB of memory?” Pertinent if you’re doing computing with your mac, and that silly program is at the top of your “top -o rsize” I just saw it there, found this helpful post, and decided to experiment. I did this command: “sudo killall mds” and it went away. Nothing else seems to have crashed, so I hesitantly recommend this as a possible one-time solution, with caution of course. :)

    Wait, never mind. It started up again. Anyone know how to disable it?

  20. […] do MDS and MDWorker have to do with Spotlight? The MDS process and mdworker processes usually run concurrently on your Mac when Spotlight is indexing your Mac. […]

  21. […] runs the child process mdworker, the two usually run concurrently. You can read specifically about mds and Mac OS for more […]

  22. Peter says:

    Contrary to BugsMan, I liked the short article. Thanks OS X Daily for posting these short tips and hints! I didn’t know (or had forgotten) what the dot in the center of the magnifying glass means. Now I know.

    BugsMan, maybe you find some tips below your level — you have after all “used Macs from the day they were launched” as you write — then just ignore those helpful hints and be happy that we are others that benefit from them, and be happy you already are in the know.

  23. BugsMan says:

    And which particular Apple employee (Marketing Dept) wrote this?

    Quote:

    “What is MDS in Mac OS?

    “mds stands for “metadata server” and the mds process is part of Spotlight, the amazingly powerful and very useful search feature built directly into the foundation of Mac OS X. You access Spotlight by hitting Command+Spacebar.”

    I subscribe to this RSS feed because I have used Macs from the day they were launched; not to be bombasted with “the amazingly powerful …” hyperboles.

    • Paul says:

      @BugsMan

      I wish I was an Apple employee!

      Seriously though, I’ve had enough people ask me about “my Mac is running slow randomly” and “what the heck is mds and mdserver?” that I felt it justified writing an explanation. We have a pretty diverse readership here from complete novice to expert and we try to accommodate that. You’re more than welcome to email us some topics, suggestions, or even your own tips to osxdailycom@gmail.com

      I find Spotlight pretty handy and I use it constantly, so I tend to talk it up a bit, it’s not meant to convey any other message or agenda.

      – Paul

      • judy says:

        spotlight is driving me crazy. I want to disable it and I can’t. No matter what key that I hit, spotlight pops up. Pleeze help me.

        Thank you.

      • Ulrik says:

        “Spotlight, the amazingly powerful and very useful search feature built directly into the foundation of Mac OS X”

        Spotlight is a dysfunctional abomination that destroys your computer, economy and eventually your life.
        It only works in one mode. DISABLED!
        The brain farts at Apple do not understand how important it is NOT to cripple the customers home and workplace with a program that runs so wildly amok that i will pose a fire risk to your home.
        If they would just run the s#”T in nice mode, then you could forgive the sad unintelligent logic for not doing anything else than stealing CPU cycles.
        But the stupid process absolutely has to own you. WTF!

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site