Throttle v0.3.0
Throttle is a simple node.js app that allows you to simulate poor network connections (e.g. like a cellular connection) so you can test how your websites will perform. For example, testing a responsive website on a poor 3G connection without actually having to have a poor 3G connection. To use Throttle simply connect your Mac to ethernet, share that network connection via Airport, turn on Throttle, and any device connected to that WiFi access point will then be throttled to the the network speed you specify via a web-frontend. If you donβt have node.js on your computer donβt fret. Itβs very easy to install so you can get Throttle up and running quickly.
Itβs important to note that Throttle was designed to be used in conjunction with a device lab and products like shim or Adobe Edge Inspect where a shared connection is expected. That has definitely influenced its design and test cases.
Features
Throttle has some very simple features:
- Web-based app so it can be accessed & updated from any connected device or computer
- 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
Screenshot
You can see what you'll be getting if you install Throttle.
Requirements
Throttle requires the following:
- a Mac running Mac OS X 10.6.x or 10.7.x
- a Mac with both ethernet and WiFi ports (so probably won't work with a MacBook Air)
- node.js v0.8+
- express 3.0+ (if you're running express 2 or below you can try the older version of Throttle)
I highly encourage you to stay away from 32-bit-only Macs as your Throttle platform.
Installing Throttle
Installing Throttle requires modifying several different parts of your Mac.
Make Sure ipfw Can Run Without a Password
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
Install node from http://nodejs.org/. They have a handy Mac OS X installer
Download & Configure Throttle
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
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.
Connecting to Throttle to Change Bandwidth & Latency
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.
Using Adobe Edge Inspect with Throttle
To use Adobe Edge Inspect 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 Edge Inspect. I'll need to look into that.
Other Tools
Another ipfw tool for the Mac is WaterRoof. If you want to test network connection speeds you can always check-out the speedtest.net app for iOS and Android as well as, obviously, the speedtest.net website.
Credits
Throttle started as a hack to shim so thanks to that project and the team at Boston Globe for the inspiration. The presets are derived from Apple's Network Link Conditioner tool and Guy Podjarny's presentation, The Mobile Difference in Numbers. Throttle uses Twitter Bootstrap and Glyphicons for design elements.