Why is there a delay before an agent starts processing a flow?

I’m using prefect locally, with the UI and a locally running agent (or two).

When I start a flow from the UI, the agent picks up the new flow immediately, but there then appears to be a lag before it actually starts working on the flow.

While waiting it shows “pending” in the UI and the agent CLI doesn’t provide any updates for about 3 minutes… so I’m assuming it is simply waiting for some reason or another…?

I’m wondering if this is normal or possibly a delay in feedback to the UI?

Thanks.

1 Like

My suspicion is that when working with large data files these files are first copied around in the background before the flow starts.

This behaviour doesn’t seem to happen when running the flow directly from python (i.e. not via the UI).

I’m still new to prefect… so take this with a grain of salt.

1 Like

Hi, welcome to Prefect Disourse, great to have you here. Could you provide more info about your setup?

  1. Are you on Prefect 1 or 2?
  2. How did you set up your agent?
  3. Can you try setting up a new conda virtual environment, installing and starting Prefect there and check out whether your deployment is set correctly? Check this topic for more on deployments: Prefect Deployments FAQ