Hi Everyone, i have to create a replica of agent w...
# ask-community
n
Hi Everyone, i have to create a replica of agent which is connected to one orion (is it possible ?). if use then if i submit a flow run then which agent will be assigned to execute that flow run. Can anyone please help.
b
Hi Nimesh, it sounds like you have multiple Prefect servers you're self-hosting and want to ensure that each agent process connects to the correct server. Is that right? Or are you hosting a single server and want each agent to poll a unique work queue/pool?
n
Hmm partially correct. Let me explain what we want to do with a use case. 1. we need to do a inference of 100K cases in a week. 2. since we are on EKS we cannot scale (technically) 3. So we decided to create multiple instance and run agent on each instance for inference 4. all the agent will connect to one orion server. 5. we will be having two deployments. for A and B and connected to q1 and q2 respectively. with concurrency depending on the number of instance we'll be hosting. Let assume 15 instance and 15 concurrency 6. Now let say we triggered 15 a flow run. we know agent poll for a flow run. whichever agent is available will get a flow run. 7. Now i have few question (if i am correct till now). a. can it be possible that only an idle agent will get a chance to run a flow. so for example if Agent-1 is busy it will not will any other flow run. b. Let say it get picked. Now 2 flow run is executing in one particular agent. and let assume one of them gets crashed (insufficient infra issue) is it possible we can put some sort of retry so that it again retry to run same flow (as it might have regain some more resources if one of the two flow run completed succeessfully). Objective : is to run multiple agent and at a single point of time only flow run should executed in a particular agent.
b
can it be possible that only an idle agent will get a chance to run a flow. so for example if Agent-1 is busy it will not will any other flow run.
You could set a
--limit
flag on the agent process to limit the number of flow runs that it can initiate. If you have multiple agents polling the same queue, setting a limit for each agent will distribute the flow runs more evenly amongst them
Let say it get picked. Now 2 flow run is executing in one particular agent. and let assume one of them gets crashed (insufficient infra issue) is it possible we can put some sort of retry so that it again retry to run same flow (as it might have regain some more resources if one of the two flow run completed successfully).
Depending on your setup, an automation that kicks off a new flow run in response to another run of the same flow entering a
Crashed
state could help you here. Automations are available in Prefect OSS v3.0. Otherwise, if you're using 2.0, they're only available with Prefect Cloud.
n
Hi Bianca, Thankyou for the response. Can you please let me know where do i have set the
--limit
flag. I am not able to figure out where i can set this limit
Got it. Thanks a ton Bianca.
prefect spin 1
🙌 1
🚀 1