Bobcares

Google Cloud Load Balancer Sticky session

by | Jul 24, 2022

Google cloud load balancer and the sticky session can work together allowing the users to use sticky sessions with the load balancer easily.

Bobcares answers all questions no matter the size, as part of our Google cloud platform support Service

Let us take a look at the Google Cloud Load Balancer Sticky session in detail

gcp-security-checklist

Load Balancer sticky session

Session stickiness, also known as session persistence, refers to the process by which a load balancer establishes an affinity between a client and a specific network server for the duration of a session.

The factors listed down below define Session affinity:

  1. When the backend is in link with HTTPS Load Balancer, the same client redirects to the same instance or server in Session Affinity.
  2. Sticky Session or Session Affinity refers to the process of remembering where the request came from previously. And forwards it to the server that has previously created some information.
  3. If there are several servers behind the load balancer, it will identify the user and ensure that any requests from that user are en route to the same user.
  4. The advantage here is that at the server level, there will be a local cache containing data related to all users. This allows for a faster request-response cycle without a session timeout.
  5. HTTP(S) Load Balancing offers the following types of session affinity: NONE (affinity not set.) Client IP affinity Generated cookie affinity HTTP Cookie affinity

Functioning of Load Balancer and Session Affinity

The working of the google cloud load balancer sticky session is not that complicated in nature. Follow the steps given below to understand how the google cloud load balancer sticky session works.

  1. Users send requests to the Load Balancer via the internet, and each request contains a sequence of network packets. As a result, each packet will contain the IP address of the user’s machine.
  2. When the Load Balancer receives IP packets, it stores the packet’s IP address as well as the corresponding HTTP server in a table format to forward the server request.
  3. As a result, if the request is from the same machine again, then it is automatically sent to the same HTTP server using the table.

Google Cloud Load Balancer and Session Affinity

According to Google Cloud Platform documentation, HTTP(S) LB distributes requests evenly among available instances. Session affinity allows users to send to the same instance if necessary. It can identify requests from a user based on the client’s IP address or the value of a cookie. And directing such requests to a reliable instance, provided that it is strong and has the necessary resources. As affinity breaks, if the instance becomes ill or overburdened, the system should not assume perfect affinity. It is worth noting that session affinity works best when the balancing mode is set to requests per second (RPS).

Affinity for a session may lose for a variety of reasons. When new instances are added to the instance group in some cases. The target might change as the backend service reallocates load. A user can mitigate this by ensuring that the minimum number of autoscaling instances provisioned is sufficient to handle the expected load. And then only using autoscaling for unexpected increases in load. This is how the google cloud load balancer sticky session functions.

[Need assistance with similar queries? We are here to help]

Conclusion

To conclude, Session stickiness, also known as session persistence, is the method by which a load balancer establishes a connection between a client and a certain network server for the duration of a session. And, Load balancers increase app availability and responsiveness while preventing server overload.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.