Clustering guide?

Anyone have a guide on how to set up multiple lucee servers in a cluster? Im using aws.

Well that is a can of worms :slight_smile:
The easiest way is to set up your load balancer to do sticky sessions and you are done essentially.
Do you need a guide for ELB?

Ya its a can of worms for sure. Everyone says how Lucee can scale but I find so little information on how to actually scale it. I use Arora for the database, so I am not worried about that scaling the database. I’m not using docker yet. Docker seems a bit daunting to get started with, and I’m open to that path too.

I just wonder how are people scaling lucee and getting high availability and elasticity with lucee…?

So what you are saying is use EBL spin up a few servers and round robin it?

I haven’t used ELB yet so if you have something that would be great.

I appreciate the feedback.

We (at Ortus) scale Lucee by deploying it on Docker Swarm. The reason you don’t see much information about scaling Lucee is that Lucee doesn’t really need to know or care if it’s being scaled. That’s more of a matter for you to deal with in your app code and your infrastructure. If you want to avoid sticky sessions (which I recommend for true scaling and better failover), aim for these things

  • External session storage (in a cache or DB)
  • Remove all use of local file system in your code and move to CDN/S3/mapped drives, etc
  • Externalize as many services like scheduled tasks or sending mail through postmark if possible.

Other than that, your app doesn’t usually need to care too much about how many servers are out there. So long as any server/container in the cluster can process any request at any time, you can scale it up and down with whatever orchestrator works for you.

To show a Docker Swarm example, if I decide I want to have 10 containers, I just run

docker service scale my_service_name=10

(or, more realistically, I click a button in the Portainer web UI) There’s probably 1000 ways to do it, but Lucee just needs to focus on the bullets above so it doesn’t care where the next request comes from.

2 Likes