Stopping runaway CPU usage by mds, mdworker, and mdimport

I found that mds and mdimport were constantly running, and often taking up to 90-100% of my CPU when it was otherwise idle.

These processes are used by spotlight to index the hard drive and make files searchable. It usually runs when the system is idle and should run instantly whenever files are updated. My CPU usage seemed excessive though, and detrimental to battery life.

So I dug around to see if I could reduce the idle time CPU usage. This is mostly for me to refer back to later.

By running this command, I was able to see what files mdworker was opening to index:

sudo fs_usage -w -f filesys mdworker

(via http://superuser.com/questions/46195/why-does-mds-run-wild-in-mac-os-x-10-6)

… and I discovered the main culprit: Backblaze (cloud backup) was generating file lists whenever anything was change don the system, and mds was indexing them. Combing through these logs for a while, i added a few exclusions to spotlight’s indexing via the System Preference which seems to have dramatically reduced the activity mds/mdimport activity.

  • /Library/Backblaze
  • /Users/amit/Library/Caches
  • /System/Library/Caches
  • /Users/amit/Library/Cookies
  • /Users/amit/Library/Application Support/Crash Reporter
  • /Users/amit/Library/Preferences
  • /Users/amit/Library/PubSub
  • /Users/amit/Library/Application Support/Quicksilver
  • /Users/amit/Library/Safari
  • /Users/amit/Library/Application Support/Spanning Sync
  • /Users/amit/Library/Logs/Sync
  • /Users/amit/Library/Application Support/SyncServices

There were all frequently being indexed and things I didn’t need to search for.

51 notes

  1. pickled--thoughts reblogged this from superamit
  2. hkitago reblogged this from superamit
  3. victorcristian-blog reblogged this from superamit
  4. onaniena-blog reblogged this from superamit
  5. gastronomeincali reblogged this from superamit and added:
    this is very helpful for me who owns a 5 year old laptop.
  6. danielsmith89 reblogged this from superamit
  7. jephg reblogged this from superamit
  8. superamit posted this
loading

Loading more posts...