You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Georg von Zezschwitz <gv...@2scale.de> on 2007/04/06 17:02:37 UTC

Further Suggestion for easier Session Stickiness

Hi,

I'd like to suggest another extension for mod_proxy*:
I always disliked to configure the router name at both the servlet 
container like Tomcat
as well as at the frontend server.
The names even have to be exactly the same, difficult... :-).

Particulary, I like to copy the Tomcat configuration file from one 
server to the other,
and tend to forget changing jvmRoute - the only difference.

So, I want to suggest to make this more user friendly.

I can think of 3 approaches:

1) Checking in mod_proxy* if the configured route extension on a 
"Set-Cookie" by
    the backend server matches the router name and log an error otherwise.
    This would be helpful for users to understand why stickiness is not 
working.

2) Actively correct a wrong/missing ".router-name" value in Set-Cookie 
directives of
    backend connections.

3) Encourage the user to omit the "jvmRoute"-setting in the backend, add 
the routername
    on Set-Cookie in mod_proxy, and remove the router-name on incoming 
cookies before
    passing them to the backend.


My suggestion would be to add another attribute to ProxyPass, e.g.
   "cookies=(check|pass|correct|manage)
 "pass" would be the current behaviour.
 "check" should be the default (to help people when configuring their 
server)
 "correct" corrects / adds wrong / missing cookie routes
 "manage" like "correct", but does not pass the router name to the backend.

Is a patch like that welcome for trunk?

Cheers,


Georg

Re: Further Suggestion for easier Session Stickiness

Posted by Ruediger Pluem <rp...@apache.org>.

On 04/06/2007 05:02 PM, Georg von Zezschwitz wrote:
> Hi,
> 
> I'd like to suggest another extension for mod_proxy*:
> I always disliked to configure the router name at both the servlet
> container like Tomcat
> as well as at the frontend server.
> The names even have to be exactly the same, difficult... :-).
> 
> Particulary, I like to copy the Tomcat configuration file from one
> server to the other,
> and tend to forget changing jvmRoute - the only difference.
> 
> So, I want to suggest to make this more user friendly.
> 
> I can think of 3 approaches:
> 
> 1) Checking in mod_proxy* if the configured route extension on a
> "Set-Cookie" by
>    the backend server matches the router name and log an error otherwise.
>    This would be helpful for users to understand why stickiness is not
> working.
> 
> 2) Actively correct a wrong/missing ".router-name" value in Set-Cookie
> directives of
>    backend connections.
> 
> 3) Encourage the user to omit the "jvmRoute"-setting in the backend, add
> the routername
>    on Set-Cookie in mod_proxy, and remove the router-name on incoming
> cookies before
>    passing them to the backend.

I am not really in favour to reinvent the wheel if things can be already done
with other modules.

1), 2), 3) boil down to:

The administrator did not take enough care to synchronize its Tomcat configuration
with its httpd configuration. If you want to avoid this, better leave your hands
off the Tomcat configuration, omit the jvmRoute setting and set your own cookie inside
of httpd to take care of sticky sessions:

Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" env=BALANCER_ROUTE_CHANGED

This does the right thing on any of your n front end httpds and with any of your m
backend Tomcats. So your Tomcat config does not need to be different on different boxes
because of sticky sessions and the directive above can be the same on each of your httpd boxes.
Of course this does NOT work if the client does not support cookies.
But this wouldn't work with your suggestion either and as far as I understand you
it is not your intention to make this work.

Regards

RĂ¼diger