Load balancer in front of Preside

Hi there –

We have a website running Preside that will see approx. 25 x the traffic it currently does during an upcoming event, and we are obviously trying to ensure that the site will be as performant as possible.

Ideas include of course…

  • Adding the maximum of RAM and CPU possible to the DB server
  • Putting a load balancer (Nginx with the hash-ip module) in front of the application and use multiple application servers.

Any comments on this approach?

Bonus question: Saw in the docs that Redis can be used for session management. Will that work with the Preside session management as well? Any real world experience with Redis and Preside?

Thanks in advance for any comments or suggestions!

– Lutz

We host in Kubernetes and sometimes have the need to horizontally scale. Some learnings:

  1. Preside session management does not appear to be a bottle neck. Indeed, it was designed for horizontal scaling and I’d suggest you’d get minimal gains using an alternative storage (and might even go backwards)
  2. Horizontal scaling is tricky. We wrote and use GitHub - pixl8/cbjgroups: A minimal implementation of JGroups for ColdBox applications to join clusters and communicate with each other with a kubernetes adapter and network configuration for our needs. Works really well but a bunch of learnings to be had. The main thing is sharing cache clearing across nodes in the cluster but there can be other factors also.
  3. This can be handy to control the number of active Preside requests: GitHub - pixl8/preside-ext-smart-throttler: An extension to queue/throttle concurrent requests with "smart" rules to prioritize certain requests over others in any given node
  4. We have a private extension that allows setting up a waiting room system for high load. We’ve used this for things like very busy + short window event bookings for example. Besides this extension, there are third party solutions for this - i.e. Cloudflare have an offering for this
1 Like

Thanks for sharing, really appreciated!

1 Like

Hello again –

I thought I could share a quick feedback here with you guys: Dom’s hints worked great for us. Preside’s db-based session management handled the load of about 3000 concurrent sessions nicely, and running up to four Preside servers behind a standard NGINX load balancer worked great for us. Thanks again!

2 Likes