[Seaside-dev] supporting vm routes

Philippe Marschall philippe.marschall at gmail.com
Wed Dec 3 20:44:23 UTC 2008


Hi

If you're deploying Seaside on modern hardware and not using GemStone
you'll have to cook up some way of implementing sticky sessions and
load balancing. That's quite uncool. mod_jk supported what we need for
years but is limited to AJP. However, as it turns out
mod_proxy_balancer in Apache 2.2 does what we need [1], [2], [3], [4]
and works with HTTP (and AJP and FTP).

Here's what it could reverse engineer how it works. Each Smalltalk
image gets a so called route. The route is appended to the session id
after a '.'. Session ids in URLs and cookies are both supported and
can have a different, configurable keys (_s in our case). On each
incoming request Apache picks the right image according to this route.
If no route is present a "random" image is chosen according to
lbmethod.

Setting up a cluster with four images could look something like this:

<Proxy balancer://mycluster>
	Order deny,allow
	Allow from all

	BalancerMember http://127.0.0.1:8080/ loadfactor=1 route=33 min=1
max=50 keepalive=On
	BalancerMember http://127.0.0.1:8080/ loadfactor=1 route=34 min=1
max=50 keepalive=On
	BalancerMember http://127.0.0.1:8080/ loadfactor=1 route=35 min=1
max=50 keepalive=On
	BalancerMember http://127.0.0.1:8080/ loadfactor=1 route=36 min=1
max=50 keepalive=On

</Proxy>
ProxyPreserveHost On
ProxyPass /seaside balancer://mycluster/seaside STICKYSESSION=_s|_s
nofailover=On
ProxyPassReverse /seaside balancer://mycluster/seaside

To support this in Seaside we need to change the session key
generation. We need to be able to append a suffix that is configured
in the application. Julian you've spent a lot of time on sessions and
cache and stuff. What do you think is the best way to implement this?
A WAClusteredApplication that has a WARouteCache?

How do other people feel about this? Is this useful? Should this be
part of Seaside out of the box or rather be an addon like
Seaside-Cluster?

I know deploying Apache 2.2 can be a problem  in some shops ("there is
nothing new in Apache 2.2 that you need"). However I happen to know a
bug in Apache 2 and 1.3 that is fixed only in Apache 2.2 and not back
ported. Telling your admin you suffer from this tends to work ;-)

 [1] http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html
 [2] http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
 [3] http://laststation.net/2008/03/18/ajp13-made-easy-with-mod_proxy/
 [4] http://www.markround.com/archives/33-Apache-mod_proxy-balancing-with-PHP-sticky-sessions.html

Cheers
Philippe


More information about the seaside-dev mailing list