What exactly does uWSGI worker status (i.e. cheap, sig, pause etc) mean?

208 Views Asked by At

I'm trying to deal with uWSGI stats server and confused a bit with worker status. Searching internet I found only that possible values are idle, busy, pause, cheap and sig. But there is no explanation what each state means. Can someone explain me exact meanings?

As far as I understand:

  • idle — worker doing nothing and ready to process the request;

  • busy — worker processing request right now;

  • totally confused with cheap state: does it means worker is going to be killed («cheaped») by cheaper subsystem and will be spawned on high load? Or maybe it means worker is respawned after being «cheped»? Or it is «cheaped» (and thus not running at all) right now? The third seems to be right since PIDs of such workers are always zero. Вut... why are such workers counted at all?

    First I assumed that there is status entries for all possible workers, but I'm wrong: i.e. sometimes I can see 30 entries where 28 workers are cheap, after restart I can see 10 entries with 4 cheap workers. While the maximum possible workers are 32;

  • know nothing about pause and sig.

Since I need that to implement uWSGI monitoring with Prometheus/Grafana stack I looked in source code of uwsgi_exporter and found next:

        if workerStats.Status == "busy" {
            ch <- newGaugeMetric(workerDescs["busy"], float64(1.0), labelValues...)
        } else {
            ch <- newGaugeMetric(workerDescs["busy"], float64(0.0), labelValues...)
        }

Okay, there are «busy» and «not busy» workers at all. Does it means I really don't have to worry about any workers that are not in busy state while checking if workers pool is depleted?

0

There are 0 best solutions below