As we get more and more teachers every week, our regular server setup has been getting too slow. What I did first was to set up “pen” which is relatively simple load-balancer, between Apache and Zope. This allowed me to start several zope instances in different ports, and bind them to invidivual processors on the server. However, pen allocates connections to servers based on the requestors IP address, and since all requests are coming through Apache running on the same machine, all IP addresses are 127.0.0.1 and no load balancing actually happens.
Well, after some digging I switched to using Apache2.2′s own proxy_balancer module. This is very straightforward, except when users are logged in, they should always be redirected to the same Zope server, because session information isn’t shared between server instances.
To do this I had to modify the setAuthCookie script to add some internal routing information, and use sticky cookie functionality of the proxy_balancer module. Instructions for doing that are here: http://plone.org/documentation/how-to/sticky-sessions-and-mod_proxy_balancer
And it works like a charm!
(Originally posted at LeMill development)