celery.worker.autoscale
¶
Pool Autoscaling.
This module implements the internal thread responsible for growing and shrinking the pool according to the current autoscale settings.
The autoscale thread is only enabled if
the celery worker --autoscale
option is used.
- class celery.worker.autoscale.Autoscaler(pool, max_concurrency, min_concurrency=0, worker=None, keepalive=30.0, mutex=None)[源代码]¶
Background thread to autoscale pool workers.
- property processes¶
- property qty¶
- class celery.worker.autoscale.WorkerComponent(w, **kwargs)[源代码]¶
Bootstep that starts the autoscaler thread/timer in the worker.
- conditional = True¶
- label = 'Autoscaler'¶
- name = 'celery.worker.autoscale.WorkerComponent'¶
- requires = (step:celery.worker.components.Pool{(step:celery.worker.components.Hub{(step:celery.worker.components.Timer{()},)},)},)¶