https://prefect.io logo
Title
c

Chandan Maruthi

05/08/2023, 6:46 PM
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
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

Bianca Hoch

05/08/2023, 7:23 PM
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

Aaron

05/08/2023, 7:29 PM
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

Chandan Maruthi

05/08/2023, 7:37 PM
Nice, thanks @Bianca Hoch and Aaron. Ill check it out
🚀 1