GCE HTTPS load balancer session affinity

740 Views Asked by At

I have a HTTPS load balancer configured with one backend service and 3 instance groups:

Endpoint protocol: HTTPS Named port: https Timeout: 600 seconds Health check: ui-health2 Session affinity: Generated cookie Affinity cookie TTL: 0 seconds Cloud CDN: disabled Instance group Zone Healthy Autoscaling Balancing mode Capacity group-ui-normal us-central1-c 1 / 1 Off Max. CPU: 80% 100% group-ui-large us-central1-c 2 / 2 Off Max. CPU: 90% 100% group-ui-xlarge us-central1-c 2 / 2 Off Max. CPU: 80% 100%

Default host and path rules, SSL terminated.

The problem is the session affinity is not working properly and I have no idea why. Most of the time it seems to work but randomly a request is answered by a different instance with the same GCLB cookie. All this reproduced with a AJAX request every 5 seconds, 20+ requests to instance A, then a request to instance B, then other 20+ requests to A...

I looked at the LB logs and there is nothing strange (apart from the random strange response), the CPU is low. Where I can find out if some instance is "unhealthy" for 5 seconds?

The Apache logs shows no errors in the health pings or the requests.

Maybe there is some strange interaction between the "Balancing mode" and the session affinity?

1

There are 1 best solutions below

0
On

The load balancer are thought to handle a considerable amount of requests. It balances the cargo of them pretty effective.

The issue here is your load balancer doesn't receive too many requests, then the change of just one request, can modify the load drastically, being an obstacle for the Load Balancer to work efficaciously.