Anco
12/12/2022, 12:23 PMAnco
12/12/2022, 12:30 PMJeff Hale
12/12/2022, 2:56 PMPREFECT_AGENT_QUERY_INTERVAL='10.0'
If you are spinning up infrastructure it could take some time.
If you are communicating with anything external, there could be some latency from your network.
If you want to schedule your flow runs you can now prefetch to get things started ahead of time.Anco
12/12/2022, 3:30 PMPREFECT_AGENT_QUERY_INTERVAL='10.0'
a bit and set it to '0.1' but the delay is still there. I'm using DaskRunner for execution, but its connecting to an already running cluster. The logging output of the distributed.core starts at the soones 7 seconds after I trigger the run_deployment. Any ideas how to shorten this time?Jeff Hale
12/12/2022, 3:39 PMAnco
12/13/2022, 9:09 AMAnco
12/13/2022, 9:10 AMAnco
12/13/2022, 9:47 AMJeff Hale
12/13/2022, 3:14 PMAnco
12/13/2022, 4:20 PMJeff Hale
12/13/2022, 4:47 PMAnco
12/13/2022, 5:05 PMRyan Peden
12/13/2022, 5:20 PMrun_deployment
, quite a few things happen:
• A call gets set to the Prefect API to create a new flow run.
• The flow run gets picked up by an agent.
• The agent opens a new subprocess and runs the flow's command (usually python -m prefect.engine
)
• The new process has to start Python, when loads, parse, and initialize prefect
and all its dependencies.
• If using remote storage, Prefect downloads all the flow code from storage. Timing can vary depending on where the code is stored and how many files get get downloaded. If the flow code is on the local filesystem, it gets copied (along with any other code in its directory or subdirectories) into a temporary subdirectory.
• The flow starts, and has to connect to the already-running Dask cluster; usually quick, but can add a bit of a delay.
5 to 15 seconds sounds is within the normal range of what I'd expect in this scenario.
If you want the flows to run in-process immediately, calling the flow functions directly instead of using run_deployment
will accomplish that, though this won't help when you need to run separate deployments with different settings or task runners.Anco
12/13/2022, 5:38 PMAnco
12/13/2022, 5:44 PMRyan Peden
12/13/2022, 5:45 PMAnco
12/13/2022, 5:47 PMAdam Gold
02/21/2023, 8:40 AM