https://prefect.io logo
#prefect-community
Title
# prefect-community
i

Ilhom Hayot o'g'li

05/24/2022, 8:38 AM
Hello! Is that mandatory to create an agent when running the flow of flow? I have been reading this example. But any agents there If created one why it is running too many processes? Should agent be killed after each run in scheduled task or is it done by program?. Otherwise it is eating too much RAM and increasing each time it runs. how to kill the agent after process.
a

Anna Geller

05/24/2022, 10:57 AM
It might be easier for you to start with Prefect 2.0 since Subflows work natively locally Yes, in Prefect 1.0 you would not only need an agent, but also both child and parent flows must be registered before you can run a flow of flows
i

Ilhom Hayot o'g'li

05/24/2022, 1:29 PM
I was intending to run only one local agent but dashboard shows 9 how? will they be terminated by program when it is terminated from IDE? Or should I enter some code to stop them working
Moreover there is issue , why it is eating too much ram I have 20 gb of free place but after running the agents I have memory issue(just eating tooo much memory) What can be wrong?
k

Kevin Kho

05/24/2022, 2:23 PM
Dashboard shows 9 agents? Are you on server or cloud?
i

Ilhom Hayot o'g'li

05/24/2022, 2:24 PM
locally running but watching it from my account
k

Kevin Kho

05/24/2022, 2:26 PM
To stop an agent, you need to just turn it off where it is running. We can’t stop agents from Cloud because the agents just ping Cloud one way. Hard to say what is eating up the RAM, do your Flows use a lot of resources?
i

Ilhom Hayot o'g'li

05/24/2022, 2:41 PM
If I run just one reseource without flow of flows it eats nothing . But if I run it with flow of flows it eats a lot . Is that because of the 2 agents? In the begining I created 2 agents with labels [a,b] and [a, c] But now I think I solved it but I don't know how. Is that ok if I remove some agents from dasshboard?
k

Kevin Kho

05/24/2022, 2:48 PM
You shouldn’t need two agents if both are local and on the same machine, yes you can remove agents from the dashboard.
i

Ilhom Hayot o'g'li

05/24/2022, 2:55 PM
prefect agent local start -l LAPTOP -l child how to put this in code?
k

Kevin Kho

05/24/2022, 2:58 PM
You could just use a command line call in Python.
i

Ilhom Hayot o'g'li

05/24/2022, 3:01 PM
Copy code
from prefect.agent.local import LocalAgent

LocalAgent().start()
something like that? where to put labels?
k

Kevin Kho

05/24/2022, 3:03 PM
That would work. You can put the Labels in the constructor. The API is here