How to test that AWS ELB sticky sessions work as intended?

1.7k Views Asked by At

I have a solution where an ELB is configured to use sticky sessions. How can I actually verify that requests for a client is actually routed to one and the same instance in the auto-scaling group behind the ELB?

2

There are 2 best solutions below

0
On

For web applications, in my dev/testing environments, I usually grab the instance-id using the EC2 meta data service and spit it out in the HTML. That way I can see what instance is serving my request.

Other than that, to my knowledge there is no way to verify sticky sessions are working unless you log session ids and all requests and check through all of your logs across each of the relevant instances.

0
On

ELB access logs contain both the requesting client's and the backend instance's IP.