X

Mac OS X 10.4 (Tiger) #16: Spotlight processor usage and performance problems; solutions

Mac OS X 10.4 (Tiger) #16: Spotlight processor usage and performance problems; solutions

CNET staff
6 min read

Spotlight processor usage and performance problems We continue to cover an issue where Mac OS X 10.4's Spotlight function consumes inordinate amounts of processor time, resulting in slower overall system performance or seemingly complete systems stalls.

Note that the issue covered here is separate from performance problems within Spotlight itself, such as the normal function where Spotlight begins a search during the string typing process, resulting in system unresponsiveness for a few seconds.

Solutions

Giving Spotlight processes less priority via "renice" For some users, giving Spotlight processes less system priority via the "renice" command results in better overall system performance, though performance from Spotlight itself may suffer.

The easiest way to perform this process is to enter the following command in the Terminal:

  • renice -n (new renice setting number) -p (process ID number)

The higher the renice setting number (up to 20), the lower the process priority. The process ID number for various Spotlight operations can be found using Activity Monitor (located in Applications/Utilities). The most implicated process is "mds" -- launch Activity Monitor, and note the process number next to "mds."

  • renice -n 19 -p NNN
(where NNN is the process number received from Activity Monitor. You can also get the process ID for "mds" with the Terminal command "ps -acx | grep mds")

This can also be accomplished with the freeware utility BeNicer. After downloading an launching this application, enter "root" as the user and select the "mds" process, then change its renice setting to a higher number (18 or 19).

Temporarily disabling Spotlight and re-launching Another workaround that has proved successful for some users is simply turning off the Spotlight indexing process for installed volumes then turning it back on.

MacFixIt reader Jeff Hirsch has instructions for doing so in the Terminal:

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)

Make sure to carefully type the "rm" command -- a typo could result in deletion of critical files.

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)

Turning Spotlight off completely Simply killing the mds process or other Spotlight-related processes in Activity Viewer, or using the above disabling process, will not keep Spotlight components from continuing use of excessive system resources for some affected users.

In this case, you can turn Spotlight off completely by editing Mac OS X's hostconfig file, which determines the system components that are loaded at startup.

First, enter the Terminal and use the command:

  • sudo pico /etc/hostconfig

to open the hostconfig file in the "pico" text editor. (For more information about using pico, type the command "man pico" in the Terminal).

Scroll down the hostconfig file and file the line that says "SPOTLIGHT=-YES-" and change it to: "SPOTLIGHT=-NO-" (without quotes).

Exit pico, saving the file, and restart Mac OS X. Spotlight will no longer launch at startup.

To go one step further and remove Spotlight from the menu bar, remove the file "Search.bundle" from the folder /System/Library/CoreServices (move it to the Desktop or another external location) and again restart.

Disabling indexing for certain folders For some users, simply turning off Spotlight indexing for particular problem folders will resolve performance issues.

For instance, the mailbox folders used by some e-mail applications will be re-indexed every time a small change is made, resulting in spikes in processor usage.

MacFixIt reader Johan Solve writes:

"I'm also experiencing high processor usage and much hard disk grinding in Tiger, and I think it's Spotlight-related. It got a bit better when I excluded my Eudora folder from Spotlight indexing, where large mailbox files would get reindexed every time a mailbox was modified by new messages."

Folders can be excluded in the "Spotlight" pane of System Preferences in the "Privacy" tab. Simply click the "+" button in the lower left corner and select the folder to be excluded, or drag the desired folder to the list.

Possible causes for Spotlight problems Meanwhile, one MacFixIt reader offers some possible explanations for why Spotlight is problematic on some systems and not others:

"My initial indexing process after installing Tiger was interrupted by a couple of reboots I had to do while installing third-party apps. This may have left me with a funky index when Spotlight tried to pick up where it had left off. I suggest letting it fully index your drives before rebooting the machine at all.

"A few users in the Discussions over at Apple noticed that they had files on their hard drive with modification dates after the current date. i.e. days/months/weeks into the future. These files may have been causing Spotlight to choke as it tried to make sense of a date that hadn't happened yet."

Previous Mac OS X 10.4 (Tiger) Coverage:

Resources

  • BeNicer
  • Mac OS X 10.4 (Tiger) #15:...
  • Mac OS X 10.4 (Tiger) #14:...
  • Mac OS X 10.4 (Tiger) #13:...
  • Mac OS X 10.4 (Tiger) #12:...
  • Mac OS X 10.4 (Tiger) #11:...
  • Mac OS X 10.4 (Tiger) #10:...
  • Mac OS X 10.4 (Tiger) #9: ...
  • Mac OS X 10.4 (Tiger) #8: ...
  • Mac OS X 10.4 (Tiger) #7: ...
  • Mac OS X 10.4 (Tiger) #6: ...
  • Mac OS X 10.4 (Tiger) #5: ...
  • Mac OS X 10.4 (Tiger) #4: ...
  • Mac OS X 10.4 (Tiger) #3: ...
  • Mac OS X 10.4 (Tiger) #2: ...
  • Mac OS X 10.4 (Tiger) arriving in users' hands
  • More from Late-Breakers