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.

Module Contents

Classes

WorkerComponent(self,w,**kwargs) Bootstep that starts the autoscaler thread/timer in the worker.
Autoscaler(self,pool,max_concurrency,min_concurrency=0,worker=None,keepalive=AUTOSCALE_KEEPALIVE,mutex=None) Background thread to autoscale pool workers.
class WorkerComponent(w, **kwargs)

Bootstep that starts the autoscaler thread/timer in the worker.

__init__(w, **kwargs)
create(w)
register_with_event_loop(w, hub)
class Autoscaler(pool, max_concurrency, min_concurrency=0, worker=None, keepalive=AUTOSCALE_KEEPALIVE, mutex=None)

Background thread to autoscale pool workers.

__init__(pool, max_concurrency, min_concurrency=0, worker=None, keepalive=AUTOSCALE_KEEPALIVE, mutex=None)
body()
_maybe_scale(req=None)
maybe_scale(req=None)
update(max=None, min=None)
force_scale_up(n)
force_scale_down(n)
scale_up(n)
scale_down(n)
_grow(n)
_shrink(n)
info()
qty()
processes()