plone / ansible-playbook

An Ansible playbook for automated deployment of full-stack Plone servers.
90 stars 74 forks source link

haproxy advanced configuration stickysession #107

Closed l00ptr closed 6 years ago

l00ptr commented 6 years ago

Hello,

I want to add some settings in haproxy.cfg dedicated to the way we balance the users between all the backend servers. A dev told me about the appsession parameter (http://cbonte.github.io/haproxy-dconv/1.9/configuration.html#4-appsession), because for him the sessions data aren't shared between the zeo client (running on the same server).

I don't know if it's true or not, I can't find the information about how plone stores the session data(https://docs.plone.org/develop/plone/sessions/index.html). But adding this line after the listen section solves our problems:

appsession __ac len 32 timeout 3h

So our listen section looks like this:

listen Plone
    bind *:8080
    appsession __ac len 32 timeout 3h
    server client1 127.0.0.1:8081 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client2 127.0.0.1:8082 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client3 127.0.0.1:8083 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client4 127.0.0.1:8084 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client5 127.0.0.1:8085 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client6 127.0.0.1:8086 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client7 127.0.0.1:8087 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client8 127.0.0.1:8088 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client9 127.0.0.1:8089 check maxconn 1 inter 10000 downinter 2000 rise 1
    server client10 127.0.0.1:8090 check maxconn 1 inter 10000 downinter 2000 rise 1

Could you tell me:

Do you think it's a good idea to add an extra parameter/variable to add a new way to customize the haproxy configuration?

Best regards, L00ptr

smcmahon commented 6 years ago

Let's handle this generally rather than addressing the specifics. I've added in master 1d9d341 a loadbalancer_listen_extra variable that allows you to add whatever you want to a listen stanza.

l00ptr commented 6 years ago

Great thx. sorry if i didn't add this variable by myself, I am not enought comfortable with Plone and HAProxy.