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.
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.