Tuesday, 6 December 2011

Throttle network speed on a Mac

I've often needed to throttle my bandwidth to replicate a slow connection. This is often useful when building mobile sites or when using ajax and you want to see how your loader message is behaving. On my PC I use Netlimiter which is very intuitive and configurable. You can specify precise speeds for different bandwidth consumers on your machine, and you can also specify different upload and download speeds.

You can't get Netlimiter for Mac, but there is a simple way of throttling your bandwidth. Simply type this into your terminal to limit your bandwidth to 20 kilobytes per second:
sudo ipfw pipe 1 config bw 20KByte/s
sudo ipfw add 100 pipe 1 src-port 80
When you're done, be sure to delete the rule:
sudo ipfw delete 100
or:
sudo ipfw flush
which will delete all custom rules.

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!