Wondering if I can run multiple instances of Orion...
# prefect-community
v
Wondering if I can run multiple instances of Orion server behind a load balancer for high availability?
c
You can run Orion as a replicaset in kubernetes
The main consideration for scaling is your database
v
I don’t use k8s, but since it’s possible in k8s, then I assume I can do it with other technologies, right?
c
Of course , although I expect that particular scenario might have a little less engagement from the community as most who need HA and scaling like this do use k8s
v
thanks!
c
We don’t have tutorials or docs to set up this specific deployment approach, so it might be a good opportunity for a discourse !
v
I guess my question was if Prefect Orion is stateless. If it’s stateless then I can run multiple intances behind a balancer, if not — then not 🙂
z
You’ll probably want to run services separately
The API itself is stateless, but you’ll also need to manage the number of database connections as you scale up.
Here are all the services we run normally: https://github.com/PrefectHQ/prefect/blob/main/src/prefect/orion/api/server.py#L375 You can disable them in the API pod then run them directly to scale them.
I believe most of them can run duplicates but we replace many of them wholesale in Cloud for performance.
v
than’s very helpful, thanks!
do you know if prefect supports pgbouncer in transaction mode? Here is the list of postgres features that are supported and not depending on the mode https://www.pgbouncer.org/features.html
z
Hm I know we explored pgbouncer during development, but I think we moved away from it.
You can run the test suite against an arbitrary database though, so it should be feasible to find out.
v
really good point!!
z
We can’t prioritize support for this kind of setup right now, but we’re happy to help out if you run into issues! Curious to see how it goes 🙂
v
I looked through the https://github.com/PrefectHQ/prefect-helm and I didn’t find code that disables any of these services https://github.com/PrefectHQ/prefect/blob/main/src/prefect/orion/api/server.py#L375
z
Yeah running those separately is definitely the a more advanced performance optimization
1