Load balancing and sessions
NickName:vtortola Ask DateTime:2010-04-23T02:44:18

Load balancing and sessions

What is the better approach for load balancing on web servers? My services run in .NET and Mono, so they could be hosted on IIS or Apache2, and the will have to provide SSL connection.

I've read two main approaches, store the state in a common server and use sticky sessions, there is any other else?

I've read 3 diffent things about sticky sessions:

1)the load balancing device will know with which server did you start the connection and all the further connections from that host will be routed to the same server.

2)the load balancing devide read a cookie named: JSESSIONID

3)the load balancing devide read a cookie named: ASPSESSIONID

I'm a little bit confused, what will happen exactly? As the connections will be SSL there is not a chance for the load balancing devide of read the cookies, so then what?

About store the estate in a common server, what solutions do you know? I've read memcache is a good solution but is there any other else?

Cheers.

Copyright Notice:Content Author:「vtortola」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/2693510/load-balancing-and-sessions

Answers
Eric Eijkelenboom 2010-04-22T18:58:48

When using SSL with a load balancer, it is common to put the SSL certificate on the load balancing server, and not on the back end servers. In this way you only need 1 certificate on 1 server. The load balancer then talks to the back end servers using plain HTTP. This obviously requires that your back end servers are not directly accessible from the internet. \n\nSo, if the load balancer is responsible for decrypting the request, it will also be able to inspect the request for a jsessionid. \n\nSticky sessions work well with Apache as load balancer. You should check out the Apache modules mod_proxy and mod_proxy_balancer. ",


More about “Load balancing and sessions” related questions

Load balancing and sessions

What is the better approach for load balancing on web servers? My services run in .NET and Mono, so they could be hosted on IIS or Apache2, and the will have to provide SSL connection. I've read two

Show Detail

SignalR and Load Balancing With Active/Active Sticky Sessions

We have an application that uses SignalR to update clients UI, currently the app is hosted on IIS which we maintain and our clients are connceted directly to us. We are however in the process of

Show Detail

Load balancing with stateful sessions

My application is currently deployed in multiple instances and load balancing is performed with NginX reverse proxy. The problem is that some request to the server may be very expensive. Sometimes

Show Detail

Load Balancing with the WSHttp Binding: Do not use reliable sessions? WHY?

We have WCF service X: deployed on server A and Server B, host address: http://127.0.0.1:8777/ServiceX/ And we load balance the two servers. We accesss the service via http://myappserver/Servic...

Show Detail

PHP sessions in a load balancing cluster - how?

OK, so I've got this totally rare an unique scenario of a load balanced PHP website. The bummer is - it didn't used to be load balanced. Now we're starting to get issues... Currently the only issu...

Show Detail

Docker Load Balancing Multiple Hosts Sessions Shared Memory

I don't know exactly how load balancing and app sessions work together. Hope someone can throw some light on this. Lets say I have two nodes (host1, host2) and I am running on each of them my Web ...

Show Detail

How does Windows Azure perform load balancing?

I was trying to read up on load balancing in Windows Azure, and all the information about it is extremely vague and non-specific. All I really want is a simple answer: how does Azure perform load

Show Detail

SSL and Load Balancing

What affect does SSL have on the way load balancing works? I know that you need to use sticky sessions if you have chosen to not store you session info in the DB or Out of Process but how does that

Show Detail

SSL and Load Balancing

What affect does SSL have on the way load balancing works? I know that you need to use sticky sessions if you have chosen to not store you session info in the DB or Out of Process but how does that

Show Detail

Session affinity for HTTP load balancing on Google Cloud

Google Cloud has sticky sessions for network load balancing, but how to enable stickiness for HTTP load balancing. Just can not find...

Show Detail