6/11/2023 0 Comments Affinity synonymWell, it’s true that it will solve our issue as long as the user use a single IP address or he never change his IP address during the session. The only thing you have to know is that source IP affinity is the latest method to use when you want to “stick” a user to a server. There are a lot of issues doing that and I’m not going to detail them right now. IP source affinity to serverĪn easy way to maintain affinity between a user and a server is to use user’s IP address: this is called Source IP affinity. I’m not going to give any details on how to do it here, just google with proper keywords and you’ll get answers very quickly. It is pretty simple, you choose a way to share your session, usually a file system like NFS or CIFS, or a Database like MySql or SQLServer or a memcached then you configure each application server with proper parameters to share the sessions and to access them if required. This Technic applies to application servers which has no clustering features, or if you don’t want to enable cluster feature from. Sharing user’s session in a database or a file system Later, I’ll write an article explaining while even if you’re clustering, you still may need a load-balancer in front of your cluster to build a robust and scalable application. I’ve never configured any of them, but from Administrators I talk too, it does not seem to be an easy task.īy the way, for Web applications, clustering does not mean scaling. Only a few products on the market allow administrators to create a cluster (like Weblogic, tomcat, jboss, etc…). Use application layer information to maintain persistence between a user and a server Use IP level information to maintain affinity between a user and a server Sharing user’s session information in a database or a file system on application servers Use a clustered web application server where the session are available for all the servers To avoid this kind of problem, there are several ways: When using several application servers, then the problem occurs: what happens when a user is sending requests to a server which is not aware of its session? The user will get back to the login page since the application server can’t access his session: he is considered as a new user. When there is no load balancer involved, there won’t be any issues at all, since the single application server will be aware the session information of all users, and whatever the number of client connections, they are all redirected to the unique server. Even worse, an HTTP session can be spread over a few TCP connections… Well, HTTP is not a connected protocol: it means that the session is totally independent from the TCP connections. The Challenges of Load Balancing Web Applications In front of the servers, acting as the default gateway So, from a physical point of view, it can be plugged anywhere in the architecture: When working at layer 7 (aka Application layer), the load-balancer acts as a reverse proxy. The picture below shows how we usually install a load-balancer in an infrastructure: Learn more by registering for our webinar: “ Introduction to HAProxy Stick Tables“ A Load Balancer in an Infrastructure While some people use layer 4 load-balancers, it can be sometimes recommended to use layer 7 load-balancers to be more efficient with HTTP protocol. To ensure high availability and performance of web applications, it is common to use a load balancer.
0 Comments
Leave a Reply. |