Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to use sticky load-balancer #37

Closed
pbauer opened this issue Feb 16, 2017 · 6 comments
Closed

Add option to use sticky load-balancer #37

pbauer opened this issue Feb 16, 2017 · 6 comments

Comments

@pbauer
Copy link
Member

pbauer commented Feb 16, 2017

Would anyone be interested in added support for the hash director which allows sticky sessions? See https://varnish-cache.org/docs/4.1/reference/vmod_directors.generated.html#object-hash

Varnish 5 also supports the new shard-director. It is similar to the hash director, but can deal with changing configuration or health. https://varnish-cache.org/docs/5.0/reference/vmod_directors.generated.html#shard

@mauritsvanrees
Copy link
Member

Sounds useful to me.
cc @fredvd

@fredvd
Copy link
Member

fredvd commented Mar 12, 2017

@pbauer @mauritsvanrees This would certainly be useful, then we wouldn't need haproxy per sé anymore in our stacks. Sticky sessions are one reason I still use haproxy. Plone should work without, but the edge case is creating new content for logged in users and getting redirected to another zeoclient just afterwards and the new content not being propagated to the other zeoclients.

Cool that the directors have grown now and allow changing config, that was one of the things still being discussed when I attended A varnish meeting in Rotterdam 1.5 years ago.

@cleberjsantos
Copy link
Member

@fredvd +1

Also I've tried to work with sticky load balancer in Varnish/Plone, but it did not work very well. See here an interesting case example, using sticky load balancer in Varnish https://info.varnish-software.com/blog/proper-sticky-session-load-balancing-varnish

I'm experimenting with Varnish5/Plone something similar.

@pbauer
Copy link
Member Author

pbauer commented Mar 13, 2017

Last week I instead replaced haproxy with nginx since that seemed to be easier at least for our use-cases and also supports sticky sessions:

upstream projectx_zeoclients {
        ip_hash;
        server 127.0.0.1:9182;
        server 127.0.0.1:9183;
        server 127.0.0.1:9184;
}

The setup then is nginx > varnish > nginx > zeoclients > zeoserver.
See https://nginx.org/en/docs/http/load_balancing.html

@jensens
Copy link
Member

jensens commented Mar 13, 2017

Ever tried to use varnish for sticky sessions? hash.backend(STRING) should work here
https://varnish-cache.org/docs/5.0/reference/vmod_directors.generated.html#hash-backend

I have this in my bookmarks for a while now, but never tried it:
https://info.varnish-software.com/blog/proper-sticky-session-load-balancing-varnish
Looks like the example has some bugs, but overall it should work, read also the comments.


Update: Need to read the other messages .... ok.

@jensens
Copy link
Member

jensens commented Apr 22, 2024

Sticky sessions are no longer a thing today, so I close this one. If you plan to work further on this please reopen and go on.

@jensens jensens closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants