Troubleshooting a Slow Mac

From Provider Wiki

Jump to: navigation, search

Generally Macs don't require much in the way of maintenance to keep them running. Simply keeping them up-to-date using SoftwareUpdate and allowing them to run their Daily, Weekly, and Monthly scripts (these will run automatically unless you get in their way) is enough to keep them running fine.

However, there are a number of things that can cause a Mac to slow down, and here are a few troubleshooting steps you can take to try and make sure that a Mac is running well.

Contents

Check for Font Issues

Fonts are so important to computers that they underlie everything. If there are problems with the fonts on a computer the problems can show up everywhere. MacOS X is no exception, and usually the problem shows up as slowness, or even 4 second pauses, and an occasional crash. For some font issues you will get periodic notices in the system log about "Reserve Range Exhausted".

There are third-party font checkers and font management programs that you can buy, and those might be worth looking into for computers that use a large number of fonts, but starting with MacOS 10.4 Apple also includes FontBook, which can check fonts for issues.

To use FontBook start up the computer with 10.4 (or if the computer does not have 10.4, use a FireWire boot drive to boot it into 10.4, or boot the computer into Target Disk Mode, and check from another computer). Then open FontBook and choose "Validate File..." from the File menu. Then choose one of the following folders (you will need to do all of them, one after another):

  • /Library/Fonts
  • /System/Library/Fonts
  • ~/Library/Fonts (this is in the users folder)
  • /System Folder/Fonts (for PPC computers with "Classic" installed")

If FontBook comes up with any of the fonts as red, get rid of them immediately, replacing from a known-good copy if necessary. Any font that is in /System/Library/Fonts is necessary and should be replaced from the OS CD/DVD. These fonts are definitely causing problems.

Any font that comes up Yellow should be removed/replaced if at all possible. Having warnings is not a good place to be.

Once you have removed/replaced bad fonts, then you need to clear the font cache. With 10.4 this is rather easy, you just start up the computer with the <shift> key held down. Once it boots up, then reboot again to get back to normal mode. If you are working with prior operating systems, then you can either use one of the cache cleaning utilities that are out there, or delete the following files and then reboot:

  • /System/Library/Caches/fontTablesAnnex
  • /System/Library/Caches/com.apple.ATS.System.fcache
  • /System/Library/Caches/com.apple.ATSServer.FODB_System
  • /Library/Caches/com.apple.ATS

Checking the Disk for Errors

As with any computer, there are times when the hard drive can get corrupted, and Apple nicely provides a basic tool to deal with this: Disk Utility. It is basic, so there are plenty of things that it will not handle, but it is free, and included on every MacOS X Install disk that has been made.

To use it reboot the computer from the install disk (or other external boot disk) and after choose the language go into the menus to open Disk Utility. Once in Disk Utility first select the hard drive icon (not the partition, but the top-level item) and check on the "SMART" status. If this is anything but "Verified" then you have a hardware problem, and it is time to panic.

Then select your startup volume and choose "Repair" (it is in the "First Aid" tab, which should be the default tab). This can take a while to run, but in most cases no more than 5 minutes. On the first run we are hoping that it will tell us there was nothing to do. But it might tell us to run it again. Once it has run once and done something, you will want to run it again. If it comes up with the same message a second time, or tells you that it cannot fix the problem, it is time to turn to other tools, such as TechTools (this is included on the AppleCare disk).

Slow Startups

There are a few things that can cause a Mac to startup slowly. The first of which is that the startup disk is not set correctly. This will cause the Mac to pause right at the beginning of the startup phase and display either a blinking question mark or a blinking globe. Note: if the blinking globe stays around for more than 10 seconds, in all likelihood there is something wrong with your startup disk.

A bit of background on the blinking globe: This means that the computer is looking for a NetBoot server from which to boot. For quite some time now Macs have had the ability to boot off of specially configured network servers. Using this a Mac can be a fully functional computer without even having a hard drive. This interesting technology does have a number of trade-offs, and should only be considered for special cases.

If you are in either of these cases where it simply pauses for a moment the goes on, then there are two ways of solving this issue: you can either boot up and choose your startup disk using the Statup Disk panel in System Preferences, or you can reset the NV-RAM on your computer, and it will set the default back to the first bootable partition on an internal drive that it finds . To reset NV-RAM restart the computer and hold down the following keys (all at once):
<Apple>-<Option>-<p>-<r>
The computer should restart itself mid-way through the beginning of the boot process. Generally it is not a bad idea to let it go through a few of these cycles.

Repairing Disk Permissions

This has become a panacea for many people, and they will swear it has fixed many problems for them. However, the list of helpful things that repairing disk permissions fixes is quite rare and small. However, it is also a harmless thing to do, so it is not a bad step to take (from the shotgun approach to troubleshooting). To do this you just need to open Disk Utility, and select your boot partition. Under the "First Aid" tab there should be a "Verify Disk Permissions" and a "Repair Disk Permissions". You can safely skip the "Verify" step and go strait to "Repair".

And please note: if you look on the internet you will find places that say that this uses the receipts for everything that has been installed on your computer to decide what the permissions should be. But in fact only a small subset of what was initially installed on your computer (out of the factory usually) will be covered. The only area that can be useful in this is that the printing sub-system. This was more of an issue in the 10.2 and 10.3 days when some of the printer installers would mis-set these permissions.

Limiting Services

MacOS X comes with a number of services built-into it via the BSD layer that can be very helpful, however they are also potential targets for people looking to exploit a computer. While very, very few of these attempts are ever going to be successful (so few that it is generally only a secondary concern) the very attempts to break in can cause your computer to slow down.

The best example of this is that computers on Penn's campus are often scanned by computers off-campus (and often outside the US) for SSH servers. When those computers find a computer with a running SSH server they attempt to log into it using a list of names and passwords. Often this list can be a hundred or more big. If the computer is not bound to a network directory service (for example Microsoft's Active Directory or Apple's OpenDirectory) then the login failures often take so little time that an end-user does not even know that the (unsuccessful) attack is taking place.

However, if the computer is bound to a directory service the authentication process takes just a little more time and processor power, enough that the user might see their computer slow down for a minute or so (depending on how persistent the attacking computer is), and since the scanning computers often try the same computer multiple times during a day, and multiple days within a week, they might see it repeatedly.

This will show up in two ways: if you look in the /var/log/secure.log you will see large blocks of rejected ssh logins with the username attempted constantly changing. Sometimes it will be the same name for a while, then change, other times every single entry will be different. The usernames will also not reflect anything that is on your system. The second way is that if some of the names that the scanner is trying actually exist on your network, then it is still unlikely that they will get through, but after a set number of bad tries most directory servers will lock out that account temporarily. So other users might complain about being locked out of their accounts for "no good reason".

The example here is SSH, but FTP, or other services could also be used in the same way.

There are a few solutions, but the first thing you should consider is if that service is needed at all. If the service is not there to be exploited, then you don't have to worry about it. If that is not an option then might want to look into firewall rules to block this. Unfortunately as of 10.4 MacOS X (the non-Server versions) does not support IP ranges in the GUI firewall rule builder, and so you either have to stick with the limitations of the GUI, or not use it at all. There are some other solutions for individual protocols, but those are outside of the scope of this article.

Checking for Background Processes

MacOS X provides a lot of methods for background processes to run, and sometimes can be unknowingly running services that slow down a computer. Here is a partial list of where things can be started out of: Link title

  • cron - the "unix" way of running things on a schedule. Locations include:
    • /etc/crontab
    • /var/root/.crontab
    • ~/.crontab
  • StartupItems - The now-old way of running services such as Apache. Note that these usually have a control in System Preferences, and that usually alters settings in /etc/hostconfig
    • /Library/StatupItems
    • /System/Library/StartupItems - this should only be Apple System level things
  • Login Items - This is per-user and is controlled through System Preferences->Accounts->Login Items. The raw data is stored in ~/Library/Preferences/loginwindow.plist. Also note that things can be added to this via MCX (Workgroup Manager) and /Library/Preferences/loginwindow.plist without altering any file in the users directory.
Personal tools