Tag Info

Hot answers tagged

16

edit: My answer only covers the original unedited question, which was whether this sort of thing is typical in load balancers/reverse proxies. I'm not sure whether nginx/product X has support for this, 99.9% of my reverse proxying experience is with HAproxy. Correct. HTTP Keep-Alive on the client side, but not on the server side. Why? If you break down a ...


9

There are two main downsides: Your load isn't evenly distributed. Sticky sessions will stick, hence the name. While initial requests will be distributed evenly, you might end up with a significant number of users spending more time than others. If all of these are initially set to a single server, that server will have much more load. Typically, this ...


3

I recently read a great article in TechNet regarding "Providing Scalability for ASP.NET Applications". It went into the pros and cons of each possible solution. Take a read: TechNet June 2009 - Providing Scalability for ASP.NET Applications


3

PHP store it's session in plain files. Have you tried storing them on a common storage? Similiar question: Share PHP sessions in cloud file system Here is an article about this specific issue and different approaches: http://kevin.vanzonneveld.net/techblog/article/enhance_php_session_management/


3

HAProxy 1.5 (the current development version) implements stickiness on response with the stick store-response command. The command would be like this: stick store-response hdr(X-Session) stick on url-param(session) # the session ID is in a query parameter # if the session ID is in the path, like /session/{session ID}/doSomething # in this case, the ...


2

In addition to the excellent answer from Christopher, sticky sessions mean that you've lost a couple of the huge benefits of redundant servers -- the ability to take one or more down for maintenance, and transparency in the face of system failure. I consider sticky sessions a strong indicator of poor application architecture and/or poor programming. "Avoid ...


2

Yes, you can solve all those problems and more with the use of a centralised session store. Without knowing your application, it's impossible to point you at a definitive guide for implementing it (and it would be a Stack Overflow question anyway), but it's usually as simple as either setting an option (in frameworks like Rails) to writing a few lines of ...


2

We us an F5 Big-IP LTM for this. Configuration is straightforward. Most modern hardware load balancing solutions can do this; software solutions like Zeus should be able to as well. Many cloud providers like Rackspace and AWS provide software load balancers based on Zeus or similar technologies, if you happen to be using one of these platforms.


1

From: http://wiki.nginx.org/HttpUpstreamModule#ip_hash The key for the hash is the class-C network address of the client. Also from: nginx-0.8.53/src/http/modules/ngx_http_upstream_ip_hash_module.c: 91 static ngx_int_t 92 ngx_http_upstream_init_ip_hash_peer(ngx_http_request_t *r, 93 ngx_http_upstream_srv_conf_t *us) 94 { ... ...


1

Thanks to @Shane Madden's comments, I re-read the tomcat cluster docs in http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html, especially in this part -> "If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on it's own by ...


1

Are the balancer members setting the correct route ID in their session cookies? Yes, you'll need to define the routes on the BalancerMember lines. Something like this in your BalancerMember lines: BalancerMember ajp://1.1.1.1:8010/testing keepalive=On loadfactor=1 ping=10 ttl=600 route=testing1 And the associated ID in your Tomcat config must match: ...


1

You may get uneven balancing due to proxies, heavy users sharing the same IP, etc. And obviously if a machine fails you lose all your sessions when users are shifted to the other machine. A disadvantage that you don't have with a hybrid system with cached state loaded from a shared backend.


1

If your backend servers (tomcat) are clustered, they should replicate sessions too. In the event of an http failure, connections to 1 http node should go to another node. The jsessionid parameter should give the http / mod_jk enough info to know which node to route to (e.g. jsessionid=lkj234lkj2ljk234lj.jvmRoute1 will tell mod_jk that this session is due for ...


1

Generally sticky is the default for HTTPS and non-sticky is the default for HTTP. For HTTP you need to enable sticky sessions if part of the session state data is held locally on the server side (either only in RAM or only on local storage). For example, once a connection is authenticated to server A, it needs to continue being routed to server A because ...


1

Loadbalancers can identify sessions with cookies, parameters in the url, etc. If you use https on your loadbalancer, the loadbalancer has to do all the SSL handling itself, so it can have a look into the session. So, yes, you need a loadbalancer which terminates the SSL to the client, so it can access the session data. (no Linux Virtual Server or HAProxy ...


1

IME, there's little overhead between using file based sessions and database sessions (last time I looked at this in some detail I used master/master replication on 3 mysql nodes) - but the latter more often entails an additional network trip compared to the former (accessing a local mysql instance the difference wan't measurable compared with a local-only ...


1

The drawback of sticky-sessions is that with a growing number of nodes (in the range of > 100, > 1000) the probability of failure increases. Then it's preferable that it doesn't matter which node serves the request. However there are issues that have to be solved with sticky sessions differently, which of course depends on the requirements and the ...


1

I believe that sticky sessions are defined with the advance-balance statement. If you don't specify advanced-balance for a content, CSS won't use stickyness. Like this: content content-appA add service server1 add service server2 url "/appA/*" advanced-balance arrowpoint-cookie protocol tcp port 80 vip address 1.2.3.4 active ...


1

There's nothing available to solve this out of the box. But you could subclass MemcachedBackupSessionManager and use the backgroundProcess method (that's invoked by tomcat every second or every 10 secs, not sure about this) to ping your configured memcacheds. A very simple implementation looks like this: package de.javakaffee.web.msm; public class MyMsm ...


1

if your app is sensitive to users switching app servers while in a session, then you want the sticky hold time set to at least as long as the expiration time of the session cookie. your sticky table is set to expire entries after 30 minutes. so while your users may continue to send the same session id, if they pause for more than 30 minutes then their ...


1

If you want the server to handle SSL termination you could use: the SSL-ID to do the load balancing but is has limitations as metioned here the client IP but have impact ofe.g. large proxies If you would want to circumvent these problems you can terminate the SSL session on the LB and use cookies for stickyness. Unless some limitation with the ...


1

There seems to be a related issue: http://www.coderanch.com/t/87863/Tomcat/Tomcat-Cluster-Woes The workaround is to add: org.apache.catalina.ha.session.ClusterSessionListener.level = SEVERE to your logging.properties file.



Only top voted, non community-wiki answers of a minimum length are eligible