Back

Enable function scaling in docker swarm

  • 0
  • Self Hosted
johsv
30 Jan, 2024, 11:02

I'm looking for a way to scale appwrite running selfhosted in docker swarm. According to the benchmark guide https://book.appread.io/benchmarks#docker-swarm appwrite running in docker swarm can have only one executor and appwrite-worker-functions container and they both have to run on the same node. Which makes functions basically only scale vertically when running in docker swarm.

I have gotten suggestions that modifying the OCR image might help with this: From @Binyamin "There's a small challenge you'll need to overcome when deploying Appwrite into Docker Swarm as Appwrite uses OpenSwoole in-ram table for managing the running functions containers ... That said 1000-2000 rps mean 3,600,000 - 7,200,000 and Appwrite should be able to handle pretty nice, but you'll need to either overcome and modify the ORC image or go with Horizontal scaling."

TL;DR
Developers are discussing how to enable function scaling in Docker swarm for self-hosted Appwrite instances. Currently, Appwrite in Docker swarm only allows for one executor and one appwrite-worker-functions container on the same node, limiting function scaling to vertical scaling. One developer suggests modifying the OCR image, while another suggests using horizontal scaling by setting up independent Appwrite instances with a load balancer.
D5
30 Jan, 2024, 11:48

I think he means instead of swarm, just setting independent appwrite instances and set a load balancer to distribute the traffic between the instances, but not sure

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more