What is causing the atrocious performance of my Macbook pro?
I have a Macbook pro, both of which are evincing awful performance for day to day tasks. I'd like to know what is causing it, or failing that, how to diagnose this performance issue more effectively. I'll describe the main problem and what I think may be related effects, and hopefully someone here can lead me down the right path to an answer.
When I open my machine and it wakes up from the suspend state, the password dialog comes up, but often my keyboard input does not appear in the dialog for some time (this morning, for example, I typed my password and waited 45 seconds for the first character to appear, followed by a perceptible lag for each subsequent character). At the same time, I can hear what I believe to be the disk thrashing away madly.
The disk thrashing continues for a long time (today, 7 minutes). During that time, my computer is nigh unusable; cmd-tab takes ~10 sec to display the task switcher, typing anything into my terminal results in a wait for the command to echo, followed by slow runtimes. Chrome just beachballs for no reason.
I am running:
- OSX Lion 10.7.1
- Chrome 15.0
- Emacs 24
- Quicksilver
- Growl 1.3
- Sparrow
- Adium 1.5
- Dropbox
- Google Music Updater
- iStat Menu (installed after this started, to try diagnose the issue)
- Watts
- iTerm
- iTunes
- iCal
I do not have any remote volumes mounted; I had thought that perhaps the issue was with Quicksilver indexing AFP volumes, but evidently that's not the case.
My hardware is a Late 2010 17" MBP, 4Gb RAM, 1TB 7200RPM HD.
What tools can I use to track this down (remembering that I don't have a terminal when it's most prevalent, and in fact am not even logged in) or what's happening?
Solution 1:
My suggestion would be to, as a commenter suggested, look at the Console.app logs. Specifically use the search bar and search "I/O", and see if there are any errors. If there are it's your hard drive.
The next place to look is free RAM and running processes. If you have little free RAM this could be the culprit although given the extent of your issues I doubt it.
A rogue process chewing up processor cycles is a more likely scenario.
Lastly if all that seems within reason open up your Disk Utility.app, select your boot volume, usually "Macintosh HD", and under the First Aid tab run Verify Disk. If you get any errors then that is by far the most likely cause of your slowdowns.
If you don't get errors, select the root drive (the one above Macintosh HD in the hierarchy) and then click the Info button on the menu bar. You should get a window with some SMART attributes listed at the bottom of the list. If "Raw Read Error Rate", "Reallocated Sector Count" or "Reallocation Event Count" are anything but zeroes, it's very likely that your drive is on its way to failure.
Solution 2:
Your hard drive is probably dying. Run SMART Utility (shareware; free to run during a brief evaluation period; please support shareware; I have no affiliation with this shareware author). It talks to your drive briefly and immediately reports any problems your drive knows about. It runs very quickly -- it doesn't have to scan your whole drive or anything like that. If it reports any pending/reallocated/remapped bad sectors, your drive is dying and you should plan to replace it.
If SMART Utility doesn't report any bad sectors, then I'm wrong and it's probably not your hard drive. But I'm probably not wrong.
Note that SMART Utility reports a lot of detail that Mac OS X's built-in Disk Utility doesn't report. Disk Utility may still report "SMART status: verified" for a drive that SMART Utility will tell you has lots of bad sectors. Believe SMART Utility over Disk Utility.
Sometimes you can see the bad sector read errors reported in /var/log/kernel.log or maybe /var/log/system.log, usually in a form similar to /dev/disk0s2: I/O Error: UNDEFINED
. But searching through log files is a pain compared to how quickly you can download and run SMART Utility (assuming you can boot from a different drive to do this).
Sometimes you can erase the entire disk with Zero Out Data to force every sector to get written to, causing the drive to remap bad sectors, and sometimes this will be enough to get the drive working again. But even if you do that, it's still probably circling the drain and you should not trust it at all.
Solution 3:
In my case it was Dropbox. I had my Aperture Library with over 400,000 files (50GB) in the Dropbox.
My macbook pro (15" early 2011) has been terribly slow, and none of the usual measures helped. Clean install, resetting PRAM, repairing disk, nothing helped. Dropbox is not eating CPU, neither memory. My computer often showed the spinning beach balls at times when CPU usage was low, only a few percent, and memory usage was 50%.
Now, after many months, I have downsized Dropbox, removed Aperture from it, and suddenly my MacBook is snappy again. Important: after deleting hundreds of thousands of files, quit Dropbox, remove ~/.dropbox
completely, restart dropbox, fill in your credentials, and let dropbox merge its online copy with your local copy of your files. That will take some time, but after that you have a rejuvenated computer back.
My hunch is that a huge Dropbox consumes a resource that is not CPU, nor RAM, but something else that prevents applications to access the disk fluidly.