I have some progress to report.
wchlm wrote:
Pondini wrote:
Have you watched CPU usage while a backup is in progress (seems unlikely, but something unrelated might be going on).
Yes. Time Machine basically takes up all unused CPU cycles. I usually have Firefox and Mail running in background. I should try it one time with nothing at all running. (I think I've done this and observed no change in behavior, but I should try again to be sure.)
Well, I tried this. I turned off all apps (principally Mail.app and Firefox) and went to sleep. While I was asleep two backups took place. Here's the report from system.log for the first one.
Jan 19 03:20:43 shenkin /System/Library/CoreServices/backupd[15643]: Starting standard backup
Jan 19 03:20:43 shenkin /System/Library/CoreServices/backupd[15643]: Backing up to: /Volumes/Time Machine Bak/Backups.backupdb
Jan 19 03:22:56 shenkin /System/Library/CoreServices/backupd[15643]: No pre-backup thinning needed: 799.2 MB requested (including padding), 444.08 GB available
Jan 19 03:36:23 shenkin /System/Library/CoreServices/backupd[15643]: Copied 199424 files (58.6 MB) from volume Macintosh HD.
Jan 19 03:36:26 shenkin /System/Library/CoreServices/backupd[15643]: No pre-backup thinning needed: 728.9 MB requested (including padding), 444.02 GB available
Jan 19 03:36:34 shenkin /System/Library/CoreServices/backupd[15643]: Copied 512 files (8 KB) from volume Macintosh HD.
Jan 19 03:36:36 shenkin /System/Library/CoreServices/backupd[15643]: Starting post-backup thinning
Jan 19 03:43:57 shenkin /System/Library/CoreServices/backupd[15643]: Deleted backup /Volumes/Time Machine Bak/Backups.backupdb/shenkin /2009-01-17-215042: 444.07 GB now available
Jan 19 03:43:57 shenkin /System/Library/CoreServices/backupd[15643]: Post-back up thinning complete: 1 expired backups removed
Jan 19 03:43:58 shenkin /System/Library/CoreServices/backupd[15643]: Backup completed successfully.
Note in the above that there are still about 200k files being backed up, but the backup is taking place in 23 minutes. This is still long, but shorter than in the past by a factor of ca. 3, and likely just reflects the fact that TM is not competing with other apps for CPU time.
More interesting is the second backup. Recall that no other apps were running during the entire interval between the backup above and the following:
Jan 19 09:20:42 shenkin /System/Library/CoreServices/backupd[16980]: Starting standard backup
Jan 19 09:20:42 shenkin /System/Library/CoreServices/backupd[16980]: Backing up to: /Volumes/Time Machine Bak/Backups.backupdb
Jan 19 09:20:46 shenkin /System/Library/CoreServices/backupd[16980]: No pre-backup thinning needed: 728.9 MB requested (including padding), 444.07 GB available
Jan 19 09:20:57 shenkin /System/Library/CoreServices/backupd[16980]: Copied 460 files (10 KB) from volume Macintosh HD.
Jan 19 09:20:57 shenkin /System/Library/CoreServices/backupd[16980]: Starting post-backup thinning
Jan 19 09:29:45 shenkin /System/Library/CoreServices/backupd[16980]: Deleted backup /Volumes/Time Machine Bak/Backups.backupdb/shenkin /2009-01-17-155613: 444.10 GB now available
Jan 19 09:29:45 shenkin /System/Library/CoreServices/backupd[16980]: Post-back up thinning complete: 1 expired backups removed
Jan 19 09:29:46 shenkin /System/Library/CoreServices/backupd[16980]: Backup completed successfully.
Observations:
1. The second backup took 9 minutes.
2. Nearly all the time was taken in post-backup thinning -- why did this take so long? This is still a problem.
3. There is only a single file-copying operation, presumably because without other apps running, no files changed during the the first file-copying operation.
4. Most interestingly, it now says that it is copying only 460 files (10 KB) in contrast to 200000 files. The actual file-copying operation takes 11 seconds.
My tentative conclusions and caveats are as follows:
A. When TM says it copied 200000 files in an hour, it means that it had to look at 200000 files; most of them (as shown by external utilities, such as timedog and TimeTracker) never get copied. Presumably, it's the need to consider this large number of files that causes TM to take so long.
B. Some app -- mail or Firefox -- is causing TM to need to consider this large number of files. The same large number had to be considered when Mail and Firefox were exited shortly before the (first) backup, but this large number did not have to be considered when no apps were running over the entire backup interval.
C. It still doesn't make sense that TM should have had to consider 200000 files. I know, from having recently done Silverkeeper backups, that there are only about 440000 files on the entire system. But maybe (as Pondini implied), TM counts metadata updates as files, and maybe there are many metadata "bundles" for each file. I don't know enough about the Mac OS file system to know how this works.
D. Though the above new information should facilitate understanding (a little), it still doesn't solve the problem -- yet, anyway. TM is meant to run while one is working. I obviously can't quit all my apps each time TM runs.
E. Since Mac OS works in mysterious ways, I'll watch what happens the next time TM runs (with my apps running), to see whether the symptom has miraculously cured itself. I'll report back.