By Glenn Fleishman, MacworldAUG 25, 2009 11:00 pm PDT
Everyone wants a faster network. But before you can do anything to speed up yours, you must ascertain how fast it’s currently going. Yet measuring network speed isn’t as straightforward as you might think.
All network speeds are theoretical. Your network hardware may be rated to go 54 Mbps or 100 Mbps, but data moves at only a relatively small percentage—often no more than 50 percent—of the hardware’s rated speed.
Real-world speeds are also limited by the speed of the slowest component. If your computer can only read data at 50 Mbps from your hard drive, a Gigabit Ethernet connection can’t transport that data any faster. (It will, however, let multiple machines communicate at their top speeds simultaneously.)
By the same token, if you have a super-fast Net connection—one of the now relatively widely available (but still costly) 100 Mbps home broadband accounts, for example—and your hard drive can only write files at 60 Mbps, you might wonder whether you really need that speedy service. (Remember, though, that fast home broadband provides multiple computers fast access at the same time.)
The three tests described here will show the raw potential of your network, as well as the highest possible actual transfer rate you can achieve, based on the networking protocols you’re using, as well as the speed of your hard drives and computers.
All of these tests are performed between two computers. Before you start, make sure you connect both computers to each other (or to a network) using whatever networking method you’re trying to test.
If you’re testing the speed of your wired Gigabit Ethernet network, for example, make sure both computers are connected via a cable to a Gigabit Ethernet switch that’s part of the network. Disable other adapters using OS X’s Network preferences pane (System Preferences -> Network) or, in the case of AirPort, using its menu-bar icon (AirPort Menu > Turn AirPort Off).
Test 1: AFP speed
This test involves copying a file between two computers using
Apple Filing Protocol (AFP). It shows both how fast AFP works on your network and how fast your hard drives can read and write.
First, find a large file on the first computer, preferably about 1GB in size. One way to do so: In the Finder, select File -> New Smart Folder. Click the plus sign (+) at left and choose Size from the left pop-up menu, which reads Kind by default. (If Size isn’t on that menu, select Other, then select Size from the scrolling list.) In the second pop-up menu, choose Is Greater Than. In the field, enter 1. From the size pop-up menu, select GB.
Once you’ve found a suitable file, use Get Info in the Finder to find its precise size in megabytes. Multiply that number by 8 to convert that size to megabits.
Then, get out a stopwatch or turn on the seconds display in the menu bar’s clock (System Preferences -> Date & Time, check Display the Time with Seconds.)
Now, on that same machine, in the Finder window’s sidebar under Shared, select the second computer. (If it doesn’t appear there, go to the second computer, open System Preferences, click the Sharing preference pane, and check the File Sharing service box.)
Click on Connect As in the upper right of the window, and enter a valid user name and password for the other computer. Mount a volume from the other computer by double clicking on the volume’s name. Making a note of the current time (including seconds), drag the large file onto the other computer’s shared volume to initiate a file transfer.
When the file completes the transfer, jot down the concluding time. Subtract the finish time from the start time you noted earlier and convert the difference to seconds. Finally, divide the size of the file (in megabits) by the transfer time (in seconds) to get Mbps. That’s your transfer speed.
Test 2: Hard-drive read/writes
AJA Video Systems offers a free tool that tests the read and write speeds of your hard drive. It’s intended to check the video frame-rates your drive can handle, but it can also be used to test network performance.
Like the first test, it uses AFP to transfer data between computers. But because it writes multiple files of specific sizes, it can be more exact.
AJA System Test. After installing and launching the program, select AJA System Test Preferences from the application menu and check Enable Network Volumes. Next, after mounting your second computer in the Finder, select it from the Volume pop-up menu in AJA System Tester. Select 1.0 GB from the File Size menu and, leaving the other settings as they are and after making sure there are no other major operations on the network, click Start.
The program will now copy then read back a 1GB file to the selected volume; the report the results to you in Mbps. You can repeat the test with other machines on your network, as well as with local volumes (such as your boot drive or a USB or FireWire-connected drive) to compare performance.
Test 3: iperf
Finally, you can use an open-source software tool called iperf, which will give you the best raw numbers about overall network performance; it can also help you spot serious glitches as you see a network stressed to its maximum. But you’ll have to endure a bit of Terminal wonkiness to use it.
Using iperf will show you the fastest rate at which your network can possibly perform, exclusive of protocols such as AFP or hard drive speeds. It gives you the maximum rate at which streaming media could come from an Internet connection to your computer.
To start, you need to download and install iperf itself. You can download an older version of the program—iperf 1.7.0, which should work on both PowerPC and Intel Macs—from several sites online. If you choose that route, you must move it to your Documents folder, then carefully type the following on the command line, followed by a Return:
cd ~/Documents/; chmod u+x iperf
Or, if you have the Mac OS X developer tools, you can download and compile a newer version. Go to
Sourceforge to get the iperf source code. Click on the Download link on the main page, then click on the Download link on the next-to-the-latest release (2.0.4 at this writing). Finally, click on iperf-2.0.4.tar.gz (the latest file name).
That done, drag the downloaded iperf-2.0.4.tar.gz to your Documents folder. Launch Terminal, then type the following commands exactly as they appear, with a return at the end of each separate line:
cd ~/Documentstar xzf iperf-2.0.4.tar.gzcd iperf-2.0.4./configuremakecp src/iperf ..cd ..
That done, on each computer go to System Preferences -> Network and jot down the IP addresses assigned to all active network interfaces. (If the first three numbers of those addresses—10.1.1, for example—don’t match, the computers are likely not connected to the same network hub, or your network has more than one DHCP server. Check the connections to get the computers on the same network.)
Choose one computer to act as a server and the other as a client. You can reverse these roles whenever you like.
On the server, enter at the command line:
./iperf -s -K 1M
That 1M parameter tells iperf to send test data in 1MB chunks. You can test for smaller files by changing that variable to something smaller like 64K (64KB). (Transferring smaller files can slow the network down enormously: Moving 5,000 small files that add up to 50MB can take 10 times as long as moving one 1GB file, because of the inefficiencies of networking protocols.)
Next, on the command line of the client machine, enter at the command line:
./iperf -c 10.0.1.100 -i 1
where 10.0.1.100 is the IP address of the iperf server.
That done, iperf will flood your network with traffic and measure its speed. It will begin to report the speed of your network every second; after 10 seconds, it shows the overall average. The advantage in showing those frequent snapshots is to isolate transient events that may be lowering your overall speed—like seeing 1 Mbps one second and 100 Mbps the next.
Interpreting the results
Gigabit Ethernet should be able to deliver over 900 Mbps in raw throughput between two computers when measured using iperf, but far less when using that first AFP test. The reason: AFP has a high network overhead that reduces its throughput; 100 Mbps Ethernet should hit over 90 Mbps of raw throughput, and AFP can top out at about the same.
Wi-Fi can produce all kinds of speeds. If both computers are on 802.11n Wi-Fi using the 5 GHz band, then each bit of data is transmitted twice (once to the base station from the client and once from the base station to the server); you should see as much as 50 Mbps. If one computer is on 802.11n in 5 GHz and the other on Gigabit Ethernet, you might see 150 Mbps in raw network speeds.
Numbers far below those indicate something is wrong, and it’s time to start
troubleshooting your network.