Question on running Prefect Agents: I have several...
# ask-community
c
Question on running Prefect Agents: I have several jobs that run on Prefect. These jobs run within docker containers using infra blocks. Right now I run the agents like this
Copy code
prefect agent start --pool default-agent-pool --work-queue default
I am curious what you all recommend on running prefect agents. I ran a Prefect agent as a script on an ec2 container but I it stopped after a while. I would want the agent to always be running so I know when my UI submits a job, there is someone that will execute those jobs. Please share any best practices to run agents reliably
1
b
Hey Chandan, to run the Prefect agent in the background on an EC2 instance, I believe you can use systemd. Here's post that I shared with another user trying to accomplish a similar setup. Hope this helps!
🙌 1
a
Running as a service like Bianca said is probably the best approach. You could also run it in a tmux session so that you can always activate the session and see the activity
upvote 1
gratitude thank you 1
c
Nice, thanks @Bianca Hoch and Aaron. Ill check it out
🚀 1