Fixing a MacSlowdown

Here was an interesting issue.

Take this test: one slow Mac.  Why?

Possible causes:

  1. Age.  How old is your machine?  Is it too slow to run what we’re trying to run?  Well, I wouldn’t think an 8-core Xeon that’s two or three years old would take 2 minutes to boot MacOS, if that’s what you’re asking.
  2. Memory.  Enough for the application load?  6GB should be enough to run the Finder, and Mail.app.
  3. Network Connectivity.  I’ve found that a lot of perceived speed is related to network connectivity – latency, throughput, and don’t forget DNS lookup.  I have the Comcast 25MB/sec down package; local caching DNS server (which gets tested and monitored when things seem unaccountably pokey), and my router indicates that traffic is what I’d expect – at idle, around 20kb/sec average.  speedtest.net shows I’m getting the throughput I’d expect, too.
  4. Runaways.  What’s running on the machine that’s sapping the vital cycles I want to use?  Nothing.  CPU, total, while launching apps (no matter how many) seems well within expectations.  Normal load is well under 1.0 (15 minute average, and this is 8 cores, mind you).
  5. Waiting.  Too much i/o?  No evidence of system time spiking.  No apparent swapping going on.

So, why is the %(@#:@!! thing so slow?  The car isn’t going above a slow crawl no matter how hard I hit the gas, and there aren’t any road problems, either!

What was the answer?  Here’s what I narrowed it to:

The only resource that made sense to consider was i/o, to disk specifically.  Because I didn’t see evidence of i/o wait (and didn’t have a good benchmark of what that configuration’s theoretical speed ought to be), I decided to look at the stock HD in the machine to see whether there might be issues.

First place I looked was SMART.  Don’t ask why, I think it’s a reflection of the years I spent working with hardware (anyone remember the IBM 3390?) that generated highly reliable data on its state.  I think that since it is now 2011 we’d have done that even better.  I am frighteningly naïve sometimes.

Smart says “green”.  Green is good.  Green means go.

How about Disk Utility?  In my experience, it always finds a few things to complain about, but okay, let’s go there.  Yes, you have problems, you should run it standalone.

And… Disk Utility says I have problems.  Problems outside of its ability to fix.  “Back up your data, reformat, and try again” it says.  Of course I already am backed up.

But, you know, these days, these disks are $70-$80 or so to just replace the whole thing.  My time is worth something, I’m just going to back up (again) and toss the thing.  This is a cardinal rule: don’t throw good (time) after bad.  Make the whole thing go away.  Disks are mechanical devices, they don’t last forever, they are a key failure point, and even if I’m wrong it’s not a lot of money and it will do me good anyway to wipe and refresh.

That’s a second rule: if you have the opportunity, and if you’re going to have to do at least 50% of the work anyway, it’s always better to rebuild from scratch.  There are three reasons for this:

  1. Although I don’t literally believe in it, we say that configurations that have been actively added-to over a period of time develop “bit rot”.   That’s a shorthand term to refer to software installed and abandoned/forgotten, but now even more aptly describes OS updates.  On my Mac, there were probably updates from the Leopard days floating around there.  There were changes to system files I’d made to test ideas out that were never adopted nor reversed.  This simply adds complexity that isn’t necessary, and may be harmful.
  2. This also give me the opportunity to re-think what I do want installed on this machine, both in terms of applications and data.  Much of my stable data lives on a server, but especially with the demise of Rosetta, I probably needed to review all of those apps, and reinstalling them is likely going to make for a leaner and less-complicated system, along with not reinstalling things like the World Book Encyclopedia app.  (Yes, I had a real app by that name – probably, again, based on Rosetta).
  3. Going through this process is a lot like spring cleaning, but it’s also a good learning opportunity.  For example, how did I actually configure Wireshark? I knew I installed it somewhere and needed to write a script to start it correctly.  How did I actually get my Brother P-Touch to print correctly?  There was some work there – and this was my chance to document stuff like this.  Admittedly this is much more important on a Linux system, but there’s still value in understanding that some things are going to break on reinstallation, and it would be good to set up to collect that information for next time.

I ended up also replacing one HD with two: for the System and Applications, I installed a 60GB SSD, for my home directory and Everything Else, a 300GB 10k rpm SATA drive.  Reinstalled Mac OS X, reinstalled all of my apps (the ones I still want to use); moved my home directory and the other miscellaneous data.   And stuff did break, a bit.  Little I didn’t expect, and nothing that broke my heart.

Turns out I was right.  Boot time now ~28 seconds from power on to sign-in screen, and sign-in is well under 5s until my apps start to launch.  It’s still a mystery to me how this particular problem could be unaccompanied by any direct evidence (in the form of some resource measurement that would point a glowing red finger at the culprit, or, I guess SMART isn’t all that smart), but I have a machine that is clearly faster than it was the day it was delivered, and with years more service (I think) left.  And I’m much happier, more productive, and less puzzled.

Advertisements

9 comments on “Fixing a MacSlowdown

  1. I’m typically to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your website and keep checking for brand new information.

  2. Can I just say what a relief to seek out somebody who really is aware of what theyre speaking about on the internet. You definitely know how one can bring a difficulty to gentle and make it important. Extra folks must learn this and perceive this side of the story. I cant believe youre not more widespread since you undoubtedly have the gift.

  3. Pingback: Elektrische Zahnbuerste

  4. Once I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get 4 emails with the identical comment. Is there any approach you may take away me from that service? Thanks!

    • Alex,

      I’m a WP “newbie”, so I apologize. My theory is that comments posted but marked as spam are generating those emails even though you don’t actually see the specific response that caused the email. I think that’s what happened, and I’ll review my options for fixing this.

      Thanks for reading!
      _KMP

  5. Hi there, I discovered your web site by means of Google while looking for a related matter, your web site came up, it appears to be like good. I have bookmarked it in my google bookmarks.

  6. Thanks for all the comments! Sorry that I just noticed that the moderation function was set so as to delay them showing up… will do a better job of releasing them for posting in the future… _KMP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s