Load Balance CTFd

Are there any tips for load balancing a CTFd instance? Right now I know that you can load balance the front end (which I am most concerned about) by keeping the secret variable the same among the different instances, having them connect to the same database, and by duping all file uploads among the different servers. Is there anything else that I need to worry about?

I have the front end / redis sitting behind haproxy which is handling my load balancing in a round robin method.

Additionally, I am running the instances on (for lack of better words) directly on ubuntu and not in docker. Is there an easy way to load balance using the docker (if I can spin up more front end nodes when I need them that would be great especially if this was done automatically and when they are no longer needed, be removed).

The most important thing is that Redis is shared between all CTFd instances.

I don’t have good familiarity with HAProxy but I would recommend just using nginx to load balance between CTFd instances. You can just add upstream servers and take them out as you need to if you’re so inclined.

Docker itself won’t provide any kind of load balancing without going into orchestrators or other container management strategies. But you can just view Docker containers as isolated servers and then load balance them from nginx/HAProxy.