views:

231

answers:

4

I'm writing some code on a mobile device that uses a REST service to retrieve data from a host. That REST services is being proxied by Apache. In test mode I would like to be able to simulate network outages (as if the device has lost it's cell connection) to test the applications handling of intermittent failures. I also need to validate it's behavior with slow network connections.

I'm currently using Traffic Shaper XP to slow the network connection, but now I need something to make the Apache server send connection resets both randomly and on predefined sequences (to setup and repeat specific test scenarios).

+2  A: 

Write a little proxy that forwards TCP connections from your app to the apache server and that you can set up in your test to cut the connection after x number of bytes or milliseconds.

Nat
A: 

Is this a Unix or Linux environment? nice it up to give it lower priority then run a high CPU usage task like listening to music, playing a movie, calculating pi, etc. The low priority for Apache should create problems similar to what you're looking for.

Weegee
It's a Windows (aaack) environment.I'm thinking that I may need to standup a Linux VM to really have the control I need. I'm also thinking that I may need to write an apache module to get the level of control that I want.
Jack Cox
You might be able to do the same thing with Windows. Just set the priority to lowest (if it lets you), and then run [SuperPI](http://www.xtremesystems.com/superpi/).
Weegee
A: 

It looks like dummynet is the closest thing, but still not quiet there. For repeatable testing it would be good to have some control over dropped packets and resets.

jack

Jack Cox
A: 

On a different (or on the same) computer use the commandline tool ab to get some load on the apache. More informations here.

Hippo