Fixing slow performance on OSX 10.9, Mavericks

 

I have an early-2008 iMac which has served me pretty well for home use, but the hard drive finally died. Since replacing the drive on those machines is quite a chore, I brought it to the Apple store, and told them to go ahead and install Mavericks. Big mistake! I’ve spent several days troubleshooting slowness problems that make the computer nearly unusable. It finally seems to be on an upward curve, so I thought I’d post what I did and maybe help someone else experiencing the same issues.

Note that this system was installed on a brand new drive with no applications or utilities brought over from old systems. So it ought to work as well as it ever could. But the first thing I noticed was the slowness. Everything about it was slow and laggy, from the Finder, to the native Safari browser, to Mail.app.

Finder Slowness

Using the “File > Open” command within any application often causes a very lengthy beach-ball twirling session while the open dialog slowly comes up and very slowly displays the sidebar and the contents of the currently selected folder. By lengthy I mean in excess of a minute. Ordinarily, I would suspect Spotlight  or Time Machine, but Spotlight indexing has completed several days ago, and I have not allowed Time Machine to start up yet, since there are so many problems.


Screen Shot 2013-12-24 at 5.00.21 PM

Note the twirling “loading” symbol at bottom right.
The desktop looks blank until it is finally done finding Shared drives.


Screen Shot 2013-12-24 at 4.52.02 PM

Shutting off Shared items in Finder > Preferences cleared up a lot of these issues.


I rely heavily on being able to rapidly view the icon preview of images. So far, I’ve not been able to get that working consistently- it either twirls a “loading” symbol indefinitely or shows me the regular icon. Sometimes, after visiting the folder repeatedly, it does what it is supposed to, and displays images.

Screen Shot 2013-12-24 at 5.04.23 PM Screen Shot 2013-12-24 at 5.04.13 PM

Other things I did to improve Finder speed included repairing permissions even though it was a new disk, restarting, zapping the PRAM (restart, hold down Command, Shift, P & R keys until machine restarts again).

 

Cisco AnyConnect and the Finder

I need to use Cisco AnyConnect VPN client for work, so despite some warnings about incompatibility of the current version with Mavericks, I installed it. Most of the warnings had to do with unexpected disconnects when on wifi, and I use an wired connection with the iMac. However I found that something installed with it – Cisco Anyconnect Web Security was causing high CPU usage and slowdowns. The console was full of messages generated by AnyConnect Web Security:

acwebsecagent: Connection : Auth key is not provided or is invalid... etc.

 Screen Shot 2013-12-25 at 12.29.00 PM

I disabled Web Security following instructions I found here:

sudo /opt/cisco/anyconnect/bin/websecurity_uninstall.sh

This caused a noticeable improvement in Finder performance immediately.

After all these changes, I’ve found that the Finder is much improved, although it is still subject to slowdowns.

Mail, Time Machine, Calendar CrashPlan, or Spotlight indexing will all definitely cause a slowdown that can only be fixed by restarting. But really, multi-tasking of any sort will cause the console to start displaying “UI updates were forcibly disabled by application [whatever]” which I assume is what results in the appearance of a “hung” application.

Screen Shot 2013-12-26 at 4.13.38 PM

 

 

One way to tell if the Finder is in an unstable state is to try to mount a disk image (.dmg file). If there are problems, it will take a very long time to verify and even longer to open or copy an application from the disk image to the Applications folder. After a restart, the time goes down to mere seconds.

 

Mail slowness

When I first got the computer back, I entered all my email accounts into Mail.app. Mavericks had automatically inserted an iCloud account because of my answers to the questions it asked when I set up the system, and I added to that an Exchange account, a Gmail account and a few others.

The spinning beachball showed up almost immediately in Mail and in the rest of the system as well, once Mail had been opened. In fact once Mail had been turned on, even force-quitting it did not cure the molasses-like performance of the Finder and other applications. Only a complete shutdown and restart was sufficient to restore the system to usable speed.

In the brief gaps between freezes, I tried to check my email. Messages after October did not seem to show up but it was a little hard to tell since Mail.app was almost completely frozen most of the time. Eventually I found a discussion of previous issues with Gmail accounts in Mavericks Mail, but supposedly a patch had been released, and my system was definitely up to date – no updates outstanding. Mail’s “activity” indicator was almost hopelessly uninformative, displaying “getting 1200 of 1241” or some such numbers over and over. The main Activity window was a little better, at least it sorts out which account is at fault. I saw a lot of this – a blank or nearly blank progress bar that lasted forever, either Synchronizing or downloading or other tasks.

Screen Shot 2013-12-23 at 4.48.12 PM

Adding an email address to Contacts caused an immediate slowdown, which I discovered was related to iCloud immediately syncing. I’m not sure why that should cause such  a slowdown, but I shut off the iCloud account completely in System Preferences > Internet Accounts just to see what happened.

Eventually I found Apple forum posts that suggested deleting ALL internet accounts and starting over. With no accounts at all, Mail is quite snappy, but unfortunately I need to see my mail, so entered in only the Exchange account information. This sent Mail right back into a tailspin, but at least my new work email showed up. However it is so slow and laggy that it is completely unusable.

I also tried deleting the Exchange mail folder from ~/Library/Mail/V2/ and allowing it to redownload everything, in case something had gotten corrupted, but this did not seem to help. In fact the slowness probably has to do with the lengthy syncing processes in Exchange.

When Mail is suffering a slowdown, scrollbars always return to their default position at the bottom of the email list,  and since scrolling is usually stuck or very slow, it was quite hard to see my current email, even if it was there.

Screen Shot 2013-12-23 at 4.02.35 PMScrollbar, stuck at the bottom again…

 

 

 

 

 

 

 

 

Turning off automatic checking of email appeared to help.  I set the checking period to 15 minutes.

For a while I considered using webmail or the Airmail client available on the App store, but Mail seemed to be very slowly improving. I decided to disable the Exchange account and create a new account using  imap instead of Exchange as the account type for my work email, since some people have had success with that. So far, it seems pretty good, although it is still causing some slowdowns

I’m also testing disabling virtual memory, since  people say that they notice immediate speed gains in switching between applications. I have 8 GB of RAM installed so it should be OK in most circumstances.

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

 

Browser Slowness

When I started up the new Safari for the first time, it was molasses slow, consistently. Restart after restart failed to fix the issue for more than a few seconds. I got hints of the snappy performance that might be possible for one or two page loads, then right back to seeing white or partially loaded pages.

Partially loaded web pages

 

 

 

 

 

 

The first thing I did was change the DNS settings to use  Google’s DNS service (8.8.8.8, 8.8.8.7), since in my experience that has been the fastest lately.

DNS settings

That provided only a very brief bump in performance. At that point I also completely shut off all iCloud syncing of bookmarks and disabled DNS prefetching, according to instructions on Apple’s knowledge base 

I also shut off ALL Safari Auto Fill settings temporarily. This helped quite a bit.

Screen Shot 2013-12-25 at 5.48.39 PM

 

The usual suspects: backup utilities, Spotlight and VPN

Of course, backup utilities like Time Machine, CrashPlan, Spotlight’s indexing functions and AnyConnect VPN (when connected) can slow things down considerably.  The issues I’ve described above existed even when none of these were active.

 

The Outcome – a mostly usable system

Note that I have yet to install any major third party software, but at this time, things are at an acceptable level. I still notice a tiny lag in typing speed in Safari compared to what I was used to. This has been a fairly awful experience, and from what I can see out there on forums and discussions, I’m not alone.

Update, 2 days later

After a few more days of small improvements with no real breakthroughs to the overall snappiness I am used to, I finally wiped the drive and partitioned it in two partitions. I installed Mountain Lion on one, and the other is being held in reserve. The difference in speed and responsiveness was immediate. I may eventually try Mavericks again, but not until I hear that a lot of people are having better luck with it.

Resources:

I found these discussions and tech notes most helpful:

 

Update 12 days later

Eventually, since Mountain Lion was still slower than what I was used to (although much better and less buggy than Mavericks) I also reinstalled Snow Leopard. After working with it for a few days I decided to take the plunge and replace this computer with a new 27″ iMac. It arrived with Mountain Lion installed, working beautifully, so I decided not to allow it to upgrade to Mavericks for a while – perhaps a year or two. Although the phrase “planned obsolescence” comes to mind, the new computer is working really well, so I have to consider it a career cost that comes once every 6 or 7 years.