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.
- body()[исходный код]¶
- info()[исходный код]¶
- maybe_scale(req=None)[исходный код]¶
- property processes¶
- property qty¶
- scale_down(n)[исходный код]¶
- scale_up(n)[исходный код]¶
- update(max=None, min=None)[исходный код]¶
- class celery.worker.autoscale.WorkerComponent(w, **kwargs)[исходный код]¶
Bootstep that starts the autoscaler thread/timer in the worker.
- conditional = True¶
- create(w)[исходный код]¶
Create the step.
- info(w)[исходный код]¶
Return Autoscaler info.
- label = 'Autoscaler'¶
- name = 'celery.worker.autoscale.WorkerComponent'¶
- register_with_event_loop(w, hub)[исходный код]¶
- requires = (step:celery.worker.components.Pool{(step:celery.worker.components.Hub{(step:celery.worker.components.Timer{()},)},)},)¶