<@ULVA73B9P> can you horizontally scale the prefec...
# ask-marvin
l
@Marvin can you horizontally scale the prefect server and a prefect worker? is it okay to have multiple instances of each?
m
Yes, you can horizontally scale both the Prefect server and Prefect workers. 1. Prefect Server: You can self-host a Prefect server on Kubernetes using the prefect-server Helm chart. This allows you to manage multiple instances, which can be useful for scaling and high availability. 2. Prefect Workers: Workers are designed to poll work pools for new runs to execute. You can have multiple instances of workers, each corresponding to different execution environments. This setup allows you to handle more flow runs by distributing the workload across multiple worker instances. More details on workers can be found here. If you are using Prefect Cloud, it provides additional features such as RBAC and SSO that are not available in self-hosted versions, but the horizontal scaling principles remain similar. For more information on setting up and scaling Prefect infrastructure, you can refer to the self-hosting documentation and worker infrastructure concepts.
l
@Marvin can I have multiple instances of a worker for teh same environment infrastructure i.e 2 worker pods on my GKE cluster
m
Yes, you can have multiple instances of a Prefect worker for the same environment infrastructure, such as running two worker pods on your GKE (Google Kubernetes Engine) cluster. This setup allows you to increase the capacity for executing flow runs, as each worker polls the work pool for tasks and runs them in the specified environment. By deploying multiple worker pods, you can handle more concurrent tasks and improve the fault tolerance of your system. Each worker will independently poll the work pool and execute tasks, allowing for efficient distribution of workload. For more details on setting up workers in a Kubernetes environment, you might want to refer to the Prefect documentation on workers.