Hello! Is that mandatory to create an agent when r...
# prefect-community
i
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
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
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
Dashboard shows 9 agents? Are you on server or cloud?
i
locally running but watching it from my account
k
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
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
You shouldn’t need two agents if both are local and on the same machine, yes you can remove agents from the dashboard.
i
prefect agent local start -l LAPTOP -l child how to put this in code?
k
You could just use a command line call in Python.
i
Copy code
from prefect.agent.local import LocalAgent

LocalAgent().start()
something like that? where to put labels?
k
That would work. You can put the Labels in the constructor. The API is here