How to make apache slow and unreliable?

I am writing code on a mobile device that uses the REST service to retrieve data from the host. These REST services are verified by Apache. In test mode, I would like to simulate network failures (as if the device lost its connection to the cell) in order to test applications that handle intermittent failures. I also need to check its behavior on slow network connections.

I am currently using Traffic Shaper XP to slow down my network connection, but now I need to do something so that the Apache server sends the connection, both in random order and in predefined sequences (to configure and repeat certain test scenarios).

+6
apache testing apache2 stress-testing
source share
6 answers

DummyNet seems to be the closest thing, but it's still not quite there. For repeated testing, it would be nice to have some control over dropped packets and reloads.

+2
source share

In Apache2, you can do this slowly by editing the preview options in apache2.conf. The settings below should make apache pretty slow. They made my local web application load 700% longer.

<IfModule mpm_prefork_module> StartServers 2 MinSpareServers 2 MaxSpareServers 2 MaxClients 4 MaxRequestsPerChild 0 </IfModule> 
+3
source share

Write a small proxy server that forwards TCP connections from your application to the apache server and which you can configure in your test to disconnect the connection after x number of bytes or milliseconds.

+2
source share

Is this a Unix or Linux environment? nice , to give it a lower priority, and then complete the high task of using the processor, for example, listening to music, playing a movie, calculating pi, etc. A low priority for Apache should create problems similar to what you are looking for.

0
source share

On another (or the same) computer, use the ab command line tool to get some load on apache. More info here .

0
source share

I highly recommend https://github.com/Shopify/toxiproxy from Shopify:

Download https://github.com/Shopify/toxiproxy/releases client and server

Start the server:

  ./toxiproxy-server-linux-amd64 

On setting up a Cli proxy server for Apache on a different port, for example. 8080

 ./toxiproxy-cli create apache -l localhost:8080 -u localhost:80 

Make the connection slow and unreliable:

 ./toxiproxy-cli toxic add apache -t latency -a latency=3000 ./toxiproxy-cli toxic add apache -t limit_data -a bytes=1000 --tox=0.01 

here add 3 seconds of delay and stop after 1000 bytes for 1% of requests, there are other bandwidth options, etc. You can add or remove them during use. There are many other functions and libraries.

0
source share

All Articles