I would like to test how some websites and other services behave when using them with a slow connection, say, a maximum bandwidth of 512 kBit/s, and a delay of 500ms.
How can I do that in OS X?
Another option would be to use the Network Link Conditioner preference pane, which is installed with Xcode on 10.7 and later.
http://slowyapp.com/ is another (non-free) option.
All three options - Network Link Conditioner, ipfw and Slowy - are just UIs onto the part of the OSX network stack that can shape network traffic (dummynet), so just pick the one you're most comfortable with.
Use the builtin
We can set up a limited bandwidth, propagation delay, queue size, and a packet loss rate.
Start up a Terminal from /Applications/Utilities/Terminal.app. Then, enter the following, and prepare to enter your admin password:
The values used are self-explanatory here. For packet loss, add
Now, let's add this pipe to any connections coming to or going to port 80 (the one used for HTTP traffic).
Enjoy your slow connection. If you're done, remove these rules and delete the pipe: