Face it, web sites that load lickety-split on a dialup connection are becoming a thing of the past (yeah.. maybe they never existed in the first place). As more people move to broadband, web designers and application developers have a lot more leeway to create a richer experience, whether it’s in the form of higher bandwidth, prettier media, interactive flash and ajax applications, or, quite simply, more content all around.
Here’s the thing, though, not all “broadband” experiences are the same.
The Problem
How do you accurately gauge web application performance on different connection speeds?
If you’re in the webdev industry, you spend a lot of time online. Chances are, you have a pretty fat pipe connecting your fancy little PowerBook to the rest of the world. Chances are even better that you have an even faster connection to your development server.
So when you are developing a site, your impression of its load-time and responsiveness are not at all indicative of what most people will be seeing. How will the site load on a 3Mbit Cable connection? How about a 1Mbit ADSL connection? Lots of people only have access to 256k DSL – how does it perform to them. Is the site functional or completely useless for the poor bastard with the 56k dialup connection?
I’ll be the first to admit to visiting neighborhood coffee shops, or saturating my home connection with tons of downloads, or even asking friends to look at something with their crappy dialup connection, all to get a feeling for how a site looks to the average Joe. Methods like this are inefficient and, in general, a pain in the rear.
An I probably don't need to mention it, but it's 2006 now. You've probably excommunicated any friends that are still on dialup.
The Solution
We need to be able to simulate different connection speeds. With a couple little tricks, you can hop on a super fast connection, and throttle your Mac’s maximum transfer speed down to a turtle crawl.
There’s a unix utility called throttled that was designed to help maximize consistent download speeds by capping the upload rate of your most bandwidth greedy apps (think file sharing software). It works with your Mac’s built in firewall support and allows you to direct specific traffic through the throttled software.
The cool thing is that you can use throttled to simulate a slow connection by forcing all network traffic through the throttled bandwidth limiter. This is just what we need!
How To Simulate a Slow Connection
Download the throttled software and unzip it to a new folder. I just placed it on my desktop.
Download the startsimulate and stopsimulate scripts and unzip to the throttled folder (where you just extracted the throttled software).
Open the Terminal app and cd to the throttled folder:
cd Desktop/throttled-0.4.4/
To choose a speed, you’ll need to convert the required kilobits per second to bytes per second. To do this, just take the kbps figure, multiply by 1024, then divide by 8.
For instance, to simulate a 256k connection do this (sudo will ask for your password):
sudo ./startsimulate 32768 (256 * 1024 / 8)
Now just browse around on your brand new low-end DSL connection.
To turn it off:
sudo ./stopsimulate
Warning, this may cause brain explosions for the impatient…
Relive 1994:
sudo ./startsimulate 1843 (14.4 * 1024 / 8)
Trackback URL for this post:
http://www.blogcadre.com/trackback/982