In order to perform realistic tests for a new backend server, I'd like to process all Apache requests twice.

So simply handle all the live requests with the old server, as it's done right now, but then also 'duplicate' the requests to a different virtual host, where the new backend is deployed, which will process the request and log the response.

What's the best / most simple way to achieve this in Apache? (the backend is a FastCGI process)


I don't know that you can make Apache do that "live" - in general everything in Apache is set up to only handle any given URL once. You might be able to do something at a load balancer or network device layer to do this, as long as you make sure the response doesn't go to the client as well...

Another way to go about this is to keep a really full Apache log and then replay it at your test server using JMeter (http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Access_Log_Sampler) I don't think you can do POST payloads, but otherwise it's a decent approach.

  • We have a system to replay logs and check correctness / performance of the server. But this obviously ignores network latency, the CDN is not being used, ... So it's close, but not quiet, what would happen 'live'. I suppose we'll just switch one of the backend servers behind the load balancer and see how it holds up. Thanks for the reply. – Pieter May 31 '10 at 9:09
  • 1
    You're absolutely correct. Latency emulation technology does exist though, I wish someone would come up with an "accurate traffic replayer." I bug our suppliers in related fields (HP LoadRunner, Citrix Netscaler, Coradiant Truesight) all the time about it to no avail (though Oracle has come up with a DB traffic replayer). Now, in terms of adding in network and CDN, some of the big Internet measurement companies like Gomez and Keynote also have distributed load testing products - they work off synthetic transactions and not "real recorded traffic" however. – Ernest Mueller Jun 1 '10 at 14:18

The only way I can think of to do what you're asking is to set up a proxy to dupe the request & send it to the second back-end (and then log/throw away the second back-end's response since I assume you don't want to send it to the end-users).

That's a lot of work if all you're doing is a performance test, and Ernest's JMeter suggestion or something similar (Apache's ab utility, LoadRunner($) or some simple Perl scripting is probably better: what you care about is how it handles Peak Load, and where that peak is (i.e. "Is it faster/slower/the same compared to the current system, and can it handle more/less/the same work).

If you're trying to smoke-test the system to expose bugs/problems you really want to build and use a test suite designed to expose problems rather than relying on production data to expose every corner case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.