Speed-Testing Sites with Trickle

Recently I had need to test how a site runs on a low-speed connection. To cut a long story short, we were handling file uploads and despite the maximum upload limit being quite high, users were not able to upload large files. We happened across a solution that it may be users on slow connections hitting a timeout instead of a size limit. To test this, we needed to slow our own connection down to simulate the problem. This is where Trickle comes in.

Trickle is a great little utility that can be used to launch applications and restrict the amount of bandwidth available to them. It does this by emulating the usual OS functions for network access, sitting between the app and the OS. Download Trickle from the homepage and uncompress it. Build it using the standard process:

./configure
make
sudo make install

The trickle binary will now be available in your path and you’ll be able to launch applications from the command-line using it. Open a terminal window and try starting Firefox with the following command:

trickle -d 10 firefox

This will start Firefox with download speeds limited to 10kbps – around the level of dial-up connections. Navigate to a site and you’ll immediately see the difference in speed. This is great for testing how quickly your site loads on slower connections. Have a look at your site and see what can be improved – do certain images or javascript load before content or does table-rendering mean the user is left looking at a blank screen for a while?

This only restricts the downstream bandwidth though and we wanted to test upstream. We used the following command:

trickle -u 10 firefox

This restricts the upload speed to 10kbps, similar to how we did for the download speed. We could have used the -d option as well to restrict upstream and downstream, but as we only wanted to test one, we didn’t make life difficult for ourselves. This did highlight a problem in our app, which in case anyone is interested, we solved by increasing the timeout for our upload target file using the .htaccess file.

This entry was posted in Server Admin and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>