Throttle is a simple node.js app that makes it easier to test how a website performs on poor network connections. For example, testing a responsive website on a poor 3G connection without actually having to have a poor 3G connection. Simply connect your Mac to ethernet, share the network connection via Airport, run Throttle, and any connected device will then be throttled to the the network speed you specified. Throttle was designed to be used in conjunction with a device lab and products like Adobe Shadow where a shared connection is expected.
Throttle has some very simple features:
- Web-based app so it can be accessed by anyone on your local network
- Modify download network speeds for connected devices
- Modify upload network speeds for connected devices
- Modify the latency, or delay, in the network connection for connected devices
- Use presets to quickly switch between network types
- The machine Throttle is installed on and devices connect through still has a full-speed Internet connection
What you'll be getting if you install Throttle.
Throttle requires a Mac that is connected to the Internet via ethernet and that also has WiFi capabilities. Throttle has been tested on Mac OS X 10.6.8 & 10.7.4. I highly encourage you to stay away from 32-bit-only Macs as your Throttle platform.
Installing Throttle requires modifying several different parts of your Mac.
Throttle is simply a web-based wrapper for ipfw. Unfortunately, ipfw requires sudo
to run and, therefore, will prompt for a password when the command is run. This doesn't work well for a web-based product. To make sure Throttle and ipfw can run without a password do:
- At command prompt type:
sudo visudo
- Enter in your administrator password
- Using the arrow key scroll to the bottom, type
i
, hit a carriage return so you have a new line and then type:[your username] ALL= NOPASSWD: /sbin/ipfw
- Hit
ESC
and then:wq
Install node from http://nodejs.org/. They have a handy Mac OS X installer
Run the following commands from the command line:
git clone git://github.com/dmolsen/Throttle.git
cd Throttle
npm install express
npm install jade
node app.js
You should now have Throttle running on port 3000. If the node
command was unrecognized try /usr/local/bin/node app.js
for step #5
Turn on Internet Sharing so your mobile devices can connect to your Mac as a WiFi access point:
- Open Settings > Sharing
- Select the 'Internet Sharing' option
- Select 'Ethernet' from the 'Share your connection from:' dropdown
- Mark the checkbox next to Airport
- Mark the checkbox next to 'Internet Sharing' & confirm you want to run it
Any device that uses that WiFi access point will now be throttled based on the options you choose when you configure network performance via Throttle's admin.
The easiest way to connect to Throttle from multiple desktops (e.g. designers and developers want to log on from personal machines) is by using xip.io. To do so:
- Open Settings > Network
- Note the IP address that's listed (will be something like 10.0.x.x or 192.168.x.x)
- In the address bar of your browser type:
http://10.0.x.x.xip.io:3000
where10.0.x.x
is replaced with the IP address from step #2
You should now see the Throttle admin page. As long as any designers or developers connect to the new WiFi access point they should be able to enter in the xip.io address and change the settings.
To use Adobe Shadow with Throttle simply make sure all of your devices and your desktop machine are connected to the WiFi point from the Mac Throttle is running on. Note that any latency or other options (but especially latency) will affect the speed of Adobe Shadow. I'll need to look into that.
Throttle started as a hack to shim so thanks to that project and the team at Boston Globe for the inspiration. Throttle uses Twitter Bootstrap and Glyphicons for design elements.