Hi folks, I wonder if anyone has built an auto-sca...
# community-help
a
Hi folks, I wonder if anyone has built an auto-scaling process for self-hosted Typesense? My idea is to have a Systemd Service running on each instance to discover instances with a specific tag. If the code sees a change in the quantity of instances, it will pick up the new IPs and update "nodes.txt" and within 30 seconds, Typesense should add it to the cluster, syncing the data with it. Same thing when it sees fewer instances - it would remove IPs from the file. I haven't seen this in the docs, and at least a few questions I have are untested: 1. How long does it take to sync the DB 2. What will happen with requests that the LB forwards to a node that is not synced yet 3. When you scale down, the instance will be removed from the LB target group right away, so it should not recieve traffic, but how will Typesense react to an instance being down and after 30 seconds update it's config on all nodes at relatevely the same time/
We will be using `/health`for the LB health check, I assume it should not report "healthy" until fully synced. This could also simplify the upgrade process, as all we would need to do is update the config to the newest version, destroy the node and wait for it to spin up (followers first)
k
Why don’t you use Kubernetes to host each instance as a Pod and let Kubernetes take care of the rest? Have a look here (full disclosure I am the leading maintainer) https://github.com/akyriako/typesense-operator
a
The team, that will be maintaining the project, doesn't have any k8s experience. Additionally, it's not a good practice to rely on small open source maintainers for production env. Folks can move on and the project may get abandon with all existing problems vulnerabilities. Auto scaling isn't a requirement for this project, but I wanted to explore options and this is the idea I came up with. The Systemd Service is pretty much 5 lines of bash code, nothing too crazy, I am just not too familiar with Typesense handling this scenario (adding and removing IPs from nodes.txt during runtime)
👍 1