[Setup] Load balancing with ZEO behind Apache on a Win 2.3k server

Laurence Rowe l at lrowe.co.uk
Tue Sep 30 22:49:10 UTC 2008

I don't know why turning off HT helped, but it seemed to in that case. You
mileage may vary.

Your right on the sticky session stuff, I looked a bit more deeply so am now
using the following. Remember to a2enmod headers.

    RewriteRule ^/(.*) \


    ProxyPreserveHost On
    Header add Set-Cookie "balancer_zopes=route.%{BALANCER_WORKER_ROUTE}e;
    <Proxy balancer://zopes>
            BalancerMember route=instance1 max=1
            BalancerMember route=instance2 max=1
            BalancerMember route=instance3 max=1
            BalancerMember route=instance4 max=1
            ProxySet stickysession=balancer_zopes

An issue with this is that the cookies seem to stop varnish caching anything
at all, at least with the config generated by plone.recipe.varnish 1.0rc6


Alberto Lopes wrote:
> Dear Laurence, 
> Thank you very much for your response.  It helped me already, but I've
> still got some questions, and I hope you can help me learn a little more:
> 1 - Why does turning off HT help?
> 2 - In the tutorial:  
> http://plone.org/documentation/how-to/sticky-sessions-and-mod_proxy_balancer
> Sticky sessions and mod_proxy_balancer  at Plone documentation, it is
> stated that I should modify the plone_scripts/setAuthCookie script to set
> the stickysession cookie.
> But in your code, you simply set it to __ac. Is that cookie already set,
> or should I set it again?
> Thank you again for your help. 
> Regards,
> Alberto
> Laurence Rowe wrote:
>> You may be better turning off HT in the bios and running only two zope
>> processes. This site was running on linux though so I don't know if the
>> same applies in your case.
>> When proxying it can be beneficial to set stickysession to the __ac
>> cookie so that clients go consistently to the same zope process (so they
>> consistently use the same acl_users cache). For best results you probably
>> want to run single threaded zope clients, but I don't know if the process
>> switching overhead on windows would negate this benefit or not.
>>     RewriteRule ^/(.*) \
>> balancer://zopes/VirtualHostBase/http/%{SERVER_NAME}:80/plonesite/VirtualHostRoot/$1
>> [L,P]
>>     ProxyPreserveHost On
>>     <Proxy balancer://zopes>
>>             BalancerMember
>>             BalancerMember
>>             BalancerMember
>>             BalancerMember
>>             ProxySet stickysession=__ac
>>     </Proxy>
>> Laurence

View this message in context: http://n2.nabble.com/Load-balancing-with-ZEO-behind-Apache-on-a-Win-2.3k-server-tp1126898p1130207.html
Sent from the Installation, Setup, Upgrades mailing list archive at Nabble.com.

More information about the Setup mailing list