python - How to limit the maximum number of running Celery tasks by name -


how limit number of instances of specific celery task can ran simultaneously?

i have task processes large files. i'm running problem user may launch several tasks, causing server run out of cpu , memory tries process many files @ once. want ensure n instances of 1 type of task ran @ given time, , other tasks sit queued in scheduler until others complete.

i see there's rate_limit option in task decorator, don't think want. if i'm understanding docs correctly, limit how tasks launched, won't restrict overall number of tasks running, make server crash more slowly...but still crash nonetheless.

what can push these tasks specific queue , have x number of workers processing them. having 2 workers on queue 100 items ensure there 2 tasks processed @ same time.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -