Bookmark this site!


Time Machine hangs? Spotlight responsible?

Time Machine and Spotlight run slowly over wireless...

So slowly, that it appears that the system has hung.

Time Machine is great — but ...

Making the first backup of a 60GB of data takes a very long time over wireless.

Making a large incremental backup, after being away for a week, or more takes a very long time over wireless. Even over 802.11n I find Time Machine, backing up over my WDS, manages about 1MB/sec. Say 1GB takes 16 minutes, then 60GB takes 16 hours!

If Spotlight is indexing the backup while the backup is changing, things go even slower.

Solution: For the first backup, or for an incremental backup after you've been on the road, first turn of Spotlight indexing for the backup. Then connect your Mac by ethernet cable directly to the LAN port on the Time Capsule, and leave it to chunter away overnight. Finally, turn indexing on to let Spotlight digest the backup.

To see what Time machine and Spotlight are up to, use the console to inspect the logs. Set the filter so you see messages from backupd. You should see a sequence of messages appear slowly (but no longer very slowly), like this:

Starting standard backup 
Network volume mounted at: /Volumes/Data 
Disk image /Volumes/Data/myMacBook0016cb896cb9.sparsebundle mounted at: /Volumes/Backup of myMacBook 
Backing up to: /Volumes/Backup of myMacBook/Backups.backupdb 
No pre-backup thinning needed: 2.21 GB requested (including padding), 801.41 GB available 
Copied 22 files (24.4 MB) from volume Macintosh HD. 
Starting post-backup thinning 
No post-back up thinning needed: no expired backups exist 
Backup completed successfully.

Each line starts with date and time and the label /System/Library/CoreServices/backupd[22205]


Spotlight should be allowed to index your backup — so that you can find valuable nuggets of information lost in the past. Spotlight is also very slow if it has to index 60GB over wireless — if you do this, your log may also include lines like:

Waiting for Spotlight to finish indexing /Volumes/Backup of myMacBook/Backups.backupdb 

The solution is the same — when Spotlight has lots of changed stuff to index in the backup, let it work over ethernet. If you unplug and go wireless immediately your big backup is done, Spotlight will spend a long time catching up — and it won't let the next hourly backup begin until it has caught up.

Spotlight crashes

In addition, spotlight crashes: mdworker does the Spotlight indexing — you may find messages like this:

Formulating crash report for process mdworker[22921] 
(0x10c720.mdworker[22921]) Exited abnormally: Bus error 

When this happens, it slows things down even more. It's a bug — every crash is a bug. Some discussions suggest that it may by triggered when Spotlight attempts to index ill-formatted emails.

You can tell Spotlight not to index emails — and it may have some effect. Waiting patiently also seems to work — and I need to be able to search for mail by content, so I have to let Spotlight index my mail.


bjbk said...

Great article! Good pointers to help us understand how Time Machine and Spotlight work together.


my site said...

ugh - I am dealing with this now... I guess I just need to wait