Why has my Mac become so slow? (And how do I start to answer that?)

Over the past few months, many things on my MacBook Pro have become unbearably slow. Often application switching or opening a new tab in Chrome will take up to 10 or 15 seconds.

Obviously, no one can tell me why my machine is slow based on just that, so this is a pre-question. What should I look into to start to figure out why my Mac has become so slow? I'm thinking of:

  • Is the disk getting full? (It was, but now I have 35GB free.)
  • Is the RAM filling up? (No, I've got >1.5GB free while I experience the problem.)
  • Is the CPU pegged? (No, it doesn't appear to be.)
  • Is I/O blocked? (Maybe, how does one tell?)
  • What else?

When a Mac is running slow, what are the vitals to take, and what directions should I go in based on those readings?


Solution 1:

I've found this to usually be due to a dying hard drive (especially for Macs).

One of the nice things about Macs is that they are all the same. Since most people don't have this problem with their Macs, it's probably going to be something that makes your Mac unique from the rest (length of ownership and use).

Parts wear out and get old. You'll probably want to find a way to read the raw SMART data from the drive. Having reallocated sectors is usually a good hint that the drive is on its way out (even if the status says "ok").

I use smartctl to do this. You might be able to get smartctl for Mac, for example using Homebrew running brew install smartmontools, and run:

sudo /usr/local/Cellar/smartmontools/6.2/sbin/smartctl -a /dev/disk0

Or you can run a live CD like Knoppix and load up smartctl -a /dev/sda.

From the knoppix terminal:

sudo apt-get update
sudo apt-get install smartmontools
sudo smartctl -a /dev/sda

Another thing that can slow your computer down is dust or a broken fan. If your CPU heat sink is full of dust, it might be throttling down the CPU to prevent heat damage. I think it's 8 screws and the whole bottom panel comes off providing access to just about anything.

Solution 2:

If you have a traditional hard disk drive rather than a solid state drive, the symptoms you describe sound like the early stages of hard drive failure. Some sector that gets read a lot but never written to is failing, causing lots of "slow read" retries, and eventual timeouts/failures. Because it never gets written, the drive never gets a chance to reallocate it. This can cause unbearable slowness and rainbow wheels across all kinds of activities, and persists across reboots (it often causes painfully slow booting as well).

Run the free demo of SMART Utility to see if your hard drive has any Pending, Removed, or Reallocated bad sectors. If it has any at all, it's starting to fail and you should replace it immediately.

Note that Mac OS X's built-in Disk Utility will often say "SMART status: Verified" even when there are bad sectors, so you really need to run SMART Utility, not just Disk Utility. Well, actually, as of Lion (Mac OS X v10.7.x) you can actually get to the underlying SMART error counters in Disk Utility, by clicking on the icon of the physical hard drive itself (not the partitions) and then choosing "File > Get Info...". But the third party SMART Utility does a good job of interpreting the correct counters for you, so I still recommend it.

It is sometimes possible, but not recommended, to resuscitate a hard drive with a small number of bad sectors, by formatting the entire drive (not just the individual partitions) with "Zero Out Data" enabled. This forces every sector to get written to, which allows the drive a chance to reallocate any pending bad sectors. This will probably cause the current crop of bad blocks to be taken care of, but once a drive has any bad blocks, it's probably in a death spiral and shouldn't be trusted.

By the way, it's worth noting that SMART Utility queries the drive's controller and returns results immediately; it doesn't have to waste time testing the entire disk, so there's no time waste involved.

P.S. I used to recommend that people in this situation look in the System Log and Kernel Log for messages something like "disk0s2: I/O Error: UNDEFINED", but I found that that advice was too prone to user error. It's much easier and more reliable to just download SMART Utility and run it.

Solution 3:

Just some quick food for thought: there are interrupt cycles allocated to check on functionality of vital components, for example for the fan heartbeat signal. My right fan died and the MacBook became painfully slow even before any chip would heat up enough to throttle down. It just can't handle the new interrupt situation. I know that had been an issue with another component on a different Mac platform but I can't go into details.