Am 07.11.2014 um 23:58 schrieb Christopher Schultz:

Great. We've been having some problems draining Tomcat nodes, and I
was concerned that maybe I had overlooked this one possibility. Our
next release will include a version of the recently-discussed
load-balancer draining filter/valve so we'll see how that does.

There are some tricks also in mod_jk to improve draining:

- people using an old session id without an existing session, e.g. having a JSESSIONID cookie or who bookmarked a jsessionid-encoded URL, will hinder draining. Typically clearing the cookie during logout doesn't happen. So what you can do is twi things:

- you can use mod_headers to force cookie clearing on a logout URI by setting the Set-Cookie header to an empty JSESSIONID cookie if the URI matches your logout URI

- you can use mod_setenvif or mod_rewrite to set the Apache environment variable JK_STICKY_IGNORE to "1" for requests that might have a session id but can actually be handled non-sticky. E.g. a request for a login form from a user that might use an old cookie. If mod_jk sees JK_STICKY_IGNORE it will not handle the request sticky, so if you already disabled some worker, the request will not be send there, even if the cookie points to that worker.

Finally you can use the Tomcat Manager webapp "Expire Sessions" feature. If you click it, it will not really expire sessions (actually only those that the automatic expiration would expire during the next run), but it will show a histogram of session idleness. Depending on the data you might be able to decide, when enough draining happened, e.g. the remaining sessions all or nearly all have a long idleness time (but of course shorter than the session timeout).

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to