2.5 KiB
title | layout |
---|---|
RQ: Monitoring | docs |
Monitoring is where RQ shines.
The easiest way is probably to use the RQ dashboard, a separately distributed tool, which is a lightweight webbased monitor frontend for RQ, which looks like this:
To install, just do:
{% highlight console %} $ pip install rq-dashboard $ rq-dashboard {% endhighlight %}
It can also be integrated easily in your Flask app.
Monitoring at the console
To see what queues exist and what workers are active, just type rq info
:
{% highlight console %} $ rq info high |██████████████████████████ 20 low |██████████████ 12 default |█████████ 8 3 queues, 45 jobs total
Bricktop.19233 idle: low Bricktop.19232 idle: high, default, low Bricktop.18349 idle: default 3 workers, 3 queues {% endhighlight %}
Querying by queue names
You can also query for a subset of queues, if you're looking for specific ones:
{% highlight console %} $ rq info high default high |██████████████████████████ 20 default |█████████ 8 2 queues, 28 jobs total
Bricktop.19232 idle: high, default Bricktop.18349 idle: default 2 workers, 2 queues {% endhighlight %}
Organising workers by queue
By default, rq info
prints the workers that are currently active, and the
queues that they are listening on, like this:
{% highlight console %} $ rq info ...
Mickey.26421 idle: high, default Bricktop.25458 busy: high, default, low Turkish.25812 busy: high, default 3 workers, 3 queues {% endhighlight %}
To see the same data, but organised by queue, use the -R
(or --by-queue
)
flag:
{% highlight console %} $ rq info -R ...
high: Bricktop.25458 (busy), Mickey.26421 (idle), Turkish.25812 (busy) low: Bricktop.25458 (busy) default: Bricktop.25458 (busy), Mickey.26421 (idle), Turkish.25812 (busy) failed: – 3 workers, 4 queues {% endhighlight %}
Interval polling
By default, rq info
will print stats and exit.
You can specify a poll interval, by using the --interval
flag.
{% highlight console %} $ rq info --interval 1 {% endhighlight %}
rq info
will now update the screen every second. You may specify a float
value to indicate fractions of seconds. Be aware that low interval values will
increase the load on Redis, of course.
{% highlight console %} $ rq info --interval 0.5 {% endhighlight %}