Load-testing a new origin stack by sending duplicating HTTP traffic to it


I’d like to load-test a new origin stack, by duplicating all HTTP GET traffic sent to the old-origin stack.

At this point, ideally, the request to the new stack would be fire-and-forget - generate the traffic, forwarding auth cookies, but don’t wait for the response. The old origin stack would still be the one returning the response to the user.

Is it possible to do this with Fastly VCL?!


Hi @rtyley,

Yes, you can do this, albeit without the async aspect. You will need to wait for the response from the new stack before sending the request to the old stack. You could also, for example, write a log line if the reported content size of the new stack’s response is different to the old stack.

Here’s an example of how to do something like what you want:


You might improve on this by only sending a portion of your traffic to the new stack, using our randomness functions, or ramp up gradually from 0 tom 100 percent.



One thing that might make this a little better for the end user, would be to set an ultra low time to first byte timeout on the origin you want to smoke test. That way Fastly can fail quickly, restart and go to the old origin and send the data on more quickly. This is an even better idea if the response and its data is not wanted from the smoke test.

The details of how to set the timeout are at https://docs.fastly.com/guides/debugging/changing-connection-timeouts-to-your-origin