How can I tell which server I've been load balanced to?

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.


You are not stating which protocol you are using, so I am assuming we are talking https.

Each backend probably know some information about itself, which would uniquely identify that backend. That could be a hostname or a unicast IP address. The backend can include that information in appropriate locations. You could include it in a footer on each page. Or if you think that is too visible, only include it on pages that users wouldn't visit under normal circumstances. Any error page (404, 500, etc.) should always include backend identification.

If your load balancer is only load balancing and not doing anything else, then you would be terminating https on the backend, and whenever a TCP connection is closed and the client reconnects, there is a possibility that the client gets directed to a different backend.

The load balancer could remember the most recently used backend for all client IP addresses seen within the last hour in order to reuse the same backend most of the time. Any more detailed information such as cookies and user id would be out of reach for the load balancer, so it couldn't use that to keep a user on the same backend.

This means any identification of which backend a user is using should be taken with a grain of salt, as the user could have moved between backends between the time where they experienced a problem and the time where they found out which backend they were using. But it is still valuable information, as in most cases it will help locate relevant logs quicker.