QueueMetrics forum
QueueMetrics => Running QueueMetrics => Topic started by: barryf on August 24, 2010, 15:50:27
-
Hi,
Is it possible to load balance QM, using two tomcat servers?
I have a pair of servers set up with database replication and QM/Tomcat installed on both. I set both servers in DNS for round-robin load balancing, but it appears that the session breaks down when a user hits the other server.
Any way around this?
Thanks.
-Barry
-
The session is theoretically serializable and so it should be movable in a well configured cluster... but that's not what I would do.
I would create a master-slave MySQL scenario (or use only one MySQL) and have two separate QMs with the same config that access the same database.
We have a few clients that actually set up a master-master MySQL replica as in here: http://queuemetrics.com/manuals/QM_AdvancedConfig-chunked/ar01s10.html (note that the article is still "in progress").
-
Hi,
I have MySQL Master-Master replication in place. The problem appears to be that when a client browser switches from one QM instance to the other, the session information is not there and so QM throws an authentication error. The client would present the JSESSIONID cookie, but this would not be recognized by the other QM instance.
QM does not store its session state in mysql.
-Barry
-
No it keeps it in RAM ,and may be quite large. So we suggest using sticky sessions if you ever need it to do load-balancing.
-
No it keeps it in RAM ,and may be quite large. So we suggest using sticky sessions if you ever need it to do load-balancing.
FEATURE REQUEST: have an option to store session information in MySQL (or memcached) ;-)
This would make load balancing much easier, and allow you to expire out of memory sessions which have not been used for a while, but still retrieve them if needed.
-Barry
-
That would be pretty expensive to do though - why don't you like sticky sessions? :)
-
That would be pretty expensive to do though - why don't you like sticky sessions? :)
Because that would require a hardware load balancer rather than simple round robin DNS.
-Barry
-
As QM is resource-intensive, you could likely get it to work using a simple Apache HTTPD proxying requests for multiple backend servers..... this looks promising: http://www.wellho.net/mouth/1939_mod-proxy-ajp-and-mod-proxy-balancer-examples.html
-
As QM is resource-intensive, you could likely get it to work using a simple Apache HTTPD proxying requests for multiple backend servers..... this looks promising: http://www.wellho.net/mouth/1939_mod-proxy-ajp-and-mod-proxy-balancer-examples.html
Thanks for the suggestion, but really, I could use Linux LVS load balancer just as easily. However, it still requires additional hardware ;-(
-Barry
-
You could have Apache on Server A, port 80, that points to Tomcat on Server A, port 8080 and Server B, port 8080. :-)
-
You could have Apache on Server A, port 80, that points to Tomcat on Server A, port 8080 and Server B, port 8080. :-)
Yes, I realize that, but it simply introduces a single point of failure, which is what I am trying to avoid :-(
-Barry