This lab walks you through Creating an instance with Startup Script
By using this instance, you will be creating a Instance group
You will be creating HTTPs Load Balancer
You will be enabling a Sticky Sessions known as Session affinity
You will be creating health checks.
Duration: 60 minutes
In Session Affinity, the same client always redirects to the same instance or server when the backend is attached with HTTPs Load Balancer.
The process of remembering where the request came from previously and forwarding to the server which have created some information before is called Sticky Session or Session Affinity
If you have a bunch of servers behind the Load balancer, it will identify the user and make sure that whenever a request comes from that particular user is always routed to the same user.
The benefit here is that, at the server level there will be local cache and that will have the data related to all the users. This helps you to do the request response more fastly without session timeout.
HTTP(S) Load Balancing offers the following types of session affinity:
The users send the request to the Load Balancer by using their internet and each request will have a sequence of network packets. So, each packet will have the IP address of the user's machine.
Whenever the Load Balancer receives the IP packets, it stores the IP address of the packet and it also stores the corresponding HTTP server in a table format where the request is being forwarded.
Therefore, if the request comes again from the same machine, it will automatically forward to the same HTTP server by referring to the created table.
Login into GCP Console.
Creating a VM instance
Attaching the instance in Instance Group
Creating a Load Balancer
Enabling the Sticky sessions
Creating a health check.
Verifying the Sticky Sessions