ctford
ctford

Reputation: 7297

Simulating latency when developing on a local webserver

The Performance Golden Rule from Yahoo's performance best practices is:

80-90% of the end-user response time is spent downloading all the components in the page: images, stylesheets, scripts, Flash, etc.

This means that when I'm developing on my local webserver it's hard to get an accurate idea of what the end user will experience.

How can I simulate latency so that I can understand how my application will perform when I've deployed it on the web?

I develop primarily on Windows, but I would be interested in solutions for other platforms as well.

Upvotes: 11

Views: 3455

Answers (7)

Martin Konecny
Martin Konecny

Reputation: 59601

If you need to simulate for a just a single server request, a simple way is to simply make the server sleep() for a second before returning.

Upvotes: 0

Michael Haren
Michael Haren

Reputation: 108246

Fiddler2 can do this very easily. Plus, it does so much more that is useful when doing development.

Upvotes: 7

brianegge
brianegge

Reputation: 29872

While there are many ways to simulate latency, including some very good hardware solutions, one of the easiest for me is to run a TCP proxy in a remote location. The proxy listens and then directs the traffic back to my final destination. On a remote server, I run a unix program called balance. I then point this back to my local server.

Upvotes: 0

MarkR
MarkR

Reputation: 63538

Run the web server on a nearby Linux box and configure NetEm to add latency to packets leaving the appropriate interface.

If your web server cannot run under Linux, configure the Linux box as a router between your test client machine and your web server, then use NetEm anyway

Upvotes: 1

Pete Kirkham
Pete Kirkham

Reputation: 49311

A laser modem pointed at the mirrors on the moon should give latency that's out of this world.

Upvotes: 9

Egon
Egon

Reputation: 1705

YSlow might help you out. YSlow analyzes web pages based on Yahoo!'s rules.

Firefox Throttle. This can throttle speed (Windows only).

These are plugins for Firefox.

Upvotes: 2

Jack
Jack

Reputation: 133577

You can just set up a proxy outside that will tunnel traffic from your web server to it and then back to local browser. It would be quite realistic (of course it depends where you put the proxy).

Otherwise you can find many ways to implement it in software..

Upvotes: 1

Related Questions