0

I am using the session affinity function in Google Load Balancer. However I have the problem as below.

When gave stress A-WEB Server, access server changed to B-WEB Server. According to LB parameter, when CPU utilization over 80%, changing access server. But I configured session affinity for keeping access.

I would like to keep access same server, am I missing something?

Architecture

Building 2 WEB Server with DB under the LB to search the data about some information.

Configuration LB Parameter

  • Balancing mode : Utilization
  • Maximum CPU utilization : 80% (default)
  • Capacity : 100% (default)
  • Session affinity : generated cookie
  • Affinity coolie TTL : 1800
  • Connection request headers : 300
  • Security policy : None

1 Answer 1

0

Losing session affinity regardless of type can occur (i.e client IP affinity or cookie affinity) with the instance in the following scenarios.

  1. Session affinity will not work if the target instance becomes unhealthy, Affinity is lost as the session is moved to a healthy instance. so you should not assume perfect affinity unless all the bakends are healthy.

  2. It has little meaningful effect on UDP traffic, because a session for UDP is a single request and response.

  3. If the instance group runs out of capacity, and traffic has to be routed to a different zone breaking affinity.

  4. Configuring backend service with auto-scaling adds instances to, or removes instances from, the instance group. In either case, the backend service reallocates load, and the target may move affecting session affinity.

  5. The balancing mode is set to CPU utilization, which may cause your computed capacities across zones to change, sending some traffic to another zone within the region. Check at stress condition if the server % CPU utilization exceeds the threshold level or not.

1
  • Thank you for your information. I could improved this problem. After referred to No.3 comments and session affinity details, I changed from CPU utilization to RPS. Probably I consider, when I searched a lot of data, gave stress to WEB server. And then, over 80% of CPU utilization and losing CPU capacity. Even if just a moment, when over threshold of utilization, broken session affinity.
    – toki
    Jan 16, 2019 at 5:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .