Forum Discussion

Jason_Costa_105's avatar
Jason_Costa_105
Icon for Nimbostratus rankNimbostratus
May 02, 2007

duplicating traffic to a test server

This must be a very common use case, but a cursory search did not yield any examples of how to do this:

 

 

You're testing the next version of a server product. You want to subject it to the actual load that the current version of the server is taking (and the actual distribution of IP addrs, cookies, X-headers, and other stuff that you might not be logging), but of course you don't want to service any actual user traffic.

 

 

So you want to send this test server the inbound half of all the TCP conversations that are hitting an actual production box, but you want throw away the test server's response (like redirecting to /dev/null).

 

 

Is there an iRule sample that accomplishes this?

 

 

Jason

1 Reply

  • Doubt it. It's not a very common use case at all, and it's a fairly complicated thing you want to be doing here. Most people use some combination of test tools and production pilots to do load testing.

     

     

    You're asking the F5 to maintain two distinct TCP sessions on the back end, keep track of sequence numbers, etc, but with a single client.

     

     

    At the TCP level, this doesn't make any sense at all. You're not even guaranteed to have the same response from this alternate server. What happens when you get four packets from your prod host, but six from dev? The F5 has no idea what the application data is in this case. It has no idea whether it should send the subsequent request after packet four, or after packet six.

     

     

    At the HTTP level, this could ostensibly be possible, since you've got a URI with each request. It would require a number of features in iRules that do not exist, the most critical one being the ability to arbitrarily initiate new connections to remote hosts. Even with that, it would be an expensive proposition, as you'd have to rip out the headers, etc, mock up a new HTTP request in an iRule, and send it to the back-end server. But, you don't have that ability, so it's not even an option.

     

     

    If you're absolutely hell-bent on doing this, you could achieve it by having the iRule log the full HTTP request, URI, headers, etc, to a separate log facility where a Perl script or something similar would tail the log file and issue new requests to the server you want to test with the information from the log file.

     

     

    But then, you could just use that data to create an automated test platform instead of bogging down your production BigIP in such a hare-brained scheme.