How to tell which server I’ve been load balanced to

httpload balancingrackspace-cloud

I want to test some configuration changes to one-way synchronisation between two servers that sit behind a load balancer (this is all Rackspace Cloud infrastructure FYI). The problem I have is that I can't tell which server I've been load balanced to because the IP I'm given is always the IP of the load balancer.

Is there a simple (or even not very simple) way to tell which server I've actually been directed to. I'd ideally like something in the browser because it means non-technical team members can also report issues relatively easily but any ideas on best approaches to this would be appreciated.

Additional info: Both servers run Apache and the load balancer has session persistence configured.

Best Answer

If you want to be discreet, just have the webserver identify itself in a Server: response header (RFC 2616 Sec 14.38). For example, in Apache, the information returned in that header is controlled by the ServerTokens directive. Then, it's just a matter of inspecting the response headers in Firebug, Chrome DevTools, or Safari Web Inspector timeline.

If you want to be blatantly obvious, you can have your web application embed the server name in the pages it generates as visible text. You could also report the server name in an HTML comment, which would require View Source to see.