CPU usage no more! indexing and mdworker, while compiling

When compiling programs on Mac OS X, mdworker indexes the compiled binaries… while the code is compiling.  Or horrors of horrors!  mdworker is the background process that gathers and indexes meta information (meta data) for Spotlight.  This is a great tool, but we don’t want or need it to index binaries as we are compiling a large project.

To disable indexing (and therefore disable mdworker, but not disable Spotlight) use the command:

sudo mdutil -i off -a

If you like your indexing and like to use Spotlight (like I do), be sure to turn things back on after you’re finished compiling with the command:

sudo mdutil -i on -a

But perhaps Apple has configured mdworker to only use idle CPU time, so that it doesn’t take valuable resources from the compiler.  This is a good question for a later post.  What’s your experience been like?

3 thoughts on “CPU usage no more! indexing and mdworker, while compiling

  1. Thanks for the information.

    I tried this but it said ‘invalid operation, no index.’ I partitioned my drive on my Macbook (10.5.8) and it referenced the partition for the operation. I have thousands of music files and videos on this 320 gig drive and the MD worker is using up my resources and driving me insane. I know for a fact there are corrupt files on the drive, but it’s like a needle in a haystack. Any suggestions?

    Thanks, again.

  2. Good question. You can try the “-v” option and see if you get more information. My guess is that mdutil will not turn indexing on or off if no index has been yet created. The manual for mdutil gives no hints :-( I suggest letting the index run over night when you’re not using the computer.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>