Open qiangxinglin opened 2 days ago
hi @qiangxinglin - thank you for the issue!
we are definitely interested in improving import times wherever we can (cc @aaazzam)
I want to do similar things as in celery
In the meantime, you may want to check this repo out. We have a bunch of docker compose based demo applications using prefect background tasks (similar to celery).
@zzstoatzz Thank you for the reply! I tried task_worker/task_runner
, have following questions:
subtask
inside a task
to simulate a flow
, it it not a real flow
. Which means the logs of the subtask
would seperate to each task
run.task_worker/task_runner
seems used websocket to subscribe works from the submitter, and the overhead is relatively small (than the traditional flow deployment
). Why deployments use poll
pattern rather than a real pub-sub
?worker
), rather than create then destroy the infra again and again.
First check
Prefect Version
3.x
Describe the current behavior
Setup a very simple
task.py
as the tutorial suggested:Then deploy it with
docker-compose.yml
:Then I write a simple
test.py
to invoke the deployment:I found that the
flow run
would stuck fromSCHEDULED
toPENDING
for a few seconds, after inspecting the source code, I decide to adjust the polling inverval:Then, the poller seems work very "hard" to pick up the flows from queue and submit it to the workers (local subprocess).
But, the
flow run
still stuck fromPENDING
toRUNNING
for 1~2 secondsDescribe the proposed behavior
The question is:
import
import
seems contain someprefect.client.*
stuff (e.g.get_client
,schemas
, etc.)Example Use
No response
Additional context
All the efforts I've made are trying to improve the latency, since most of my flows are "short task". I don't want to spend a few seconds during the "startup" staging. In
celery
, the extra overhead is quite small. I want to do similar things as incelery