Slow it Down
Most of the time, you test your apps on a fast connection, especially when working on a local machine. Most of your clients/visitors/customers aren’t so lucky, but how do you simulate their connection speed?
If you have installed Xcode on Lion, you have access to a very cool tool called Network Link Conditioner.
It is a preference pane, but not installed by default. You’ll find it in
/Developer/Applications/Utilities/Network Link Conditioner/ Simply double-click the prefPane and it will install itself.
Once enabled, you can set your network to simulate everything from 3G or Edge to typical DSL. You can even set your own profile to tweak the settings. It works at the network level, so it affects your entire system. No proxies or any other setup needed!
As an example, we have an app in development where we know the users will have high latency. Instead of just hoping they get better connections, we can simulate their situation and test it out, even when we’re using Rails on our laptops. We’re then using it to optimize to their situation, not just blindly.
Give it a shot and see how your sites fare.
 This may win the award for ugliest Apple icon. Please prove me wrong!
 Don’t prematurely optimize. That’s still bad.
Changing the entire system’s connection is neither needed nor desirable IMO.
I wrote a shell script which uses ipfw for exactly this purpose (Most probably this app uses ipfw too) here is the script- https://gist.github.com/1409218
Run it like
throttle -p 3000 -d 1000ms -s 256Kbit/s start
p - Port
d - network delay you want
s - speed
Manu: That’s a great tactic too, and I like how it only throttles one port.
The nice thing about the PrefPane is that it is visible (icon goes in your menubar when on) so you don’t forget it is running, and easier to configure/use for people who don’t live in the terminal.
Looks like iOS 6 is going to have this too!