Do you want to simulate how it feels to load your site from a mobile connection (If it’s AT&T just turn off your network for an accurate simulation- I kid, don’t sue. But seriously AT&T, figure it out.) or from a laggy network? In OS X or Linux, you’ve got everything you need already installed: ipfw (IP firewall and traffic shaper control).
Create a Pipe
Configure a pipe with the appropriate bandwidth (I’ve also added a 200 ms response delay in this example).sudo ipfw pipe 1 config bw 16bit/s delay 200ms
Attach the Pipe
In this example we’re going to use port 80, but you can also use port 443 or any other port that you may be testing communication on. Additionally, you can attach the pipe to multiple ports.sudo ipfw add 1 pipe 1 src-port 80 sudo ipfw add 2 pipe 1 dst-port 80
That’s it!
Wait a second, you say! Now your network connection is completely throttled and everything is running terribly! You need to delete both ipfw entries and the pipe that were previously created.Here’s how you undo what you’ve just done:
sudo ipfw delete 1 sudo ipfw delete 2 sudo ipfw pipe 1 delete