1

we'd like to migrate to nginx and want to have the same behaviour as we have at the moment:

We're using the following load balancing setup: Apache mod_jk with AJP connected to JBoss 4.2.3 workers. Installed JKStatusManager to configure worker settings online. Workers have sticky sessions. There is no session replication for session failover.

Unfortunately we cannot enable session replication for session failover because our session state is too big (JSF). We cannot move to client side replication because the session state is too big.

When we need to update the workers we do the following:

  • Disable 50% of the workers
  • wait about 60 minutes until these workers have 0 clients connected
  • update these workers
  • enable these workers
  • do the same for the other 50%

This is not optimal but it works very well.

Question: is it possible to achieve the same behaviour with nginx? (except AJP connections. We would like to use HTTPS in the backend with nginx-module HttpProxyModule)

Marcel
  • 150
  • 10
  • 1
    Not without changes to the source code of nginx. – Martin Fjordvald Sep 21 '11 at 11:40
  • I think you could get most of the way with something like http://just-another.net/nginxmgr-nginx-upstream-pool-manager but I don't think this handles the graceful off-load you mentioned and would require modifications. – polynomial Sep 22 '11 at 02:23

1 Answers1

1

Like Martin F said, what you want can't be done without hacking nginx -- If you're going to do that you may want to invest programming resources elsewhere instead.

You say your session data is "too big" to replicate -- How big is "too big"?
Beyond a certain point it's time to manage your own session information and put the state data in a distributed database (possibly a nice NoSQL DB like Mongo) and let that handle the replication for you...

voretaq7
  • 79,879
  • 17
  • 130
  • 214
  • 1
    Seconded. This usually also means that in a data center power failure the application won't be able to come back on-line due to the session setup issues. – polynomial Sep 22 '11 at 02:23
  • The session state can get up to 5MB :-( This is because JSF stores its component tree in the session and we can't get rid of this. – Marcel Sep 22 '11 at 10:08