Skip to main content
Table of contents



Many of our applications use Sidekiq for background job processing.

There’s a GOV.UK wrapper that will help you set it up.


There are three approaches for monitoring Sidekiq, via the Sidekiq Web interface, or the Grafana dashboard or the Console.

Sidekiq Web

Sidekiq comes with a web application, Sidekiq::Web that can display the current state of a Sidekiq installation. We have configured this to monitor multiple Sidekiq configurations used throughout GOV.UK.

We have restricted public access as the Web UI allows modifying the state of Sidekiq queues.

To gain access you should setup SSH port forwarding to a backend box belonging to the environment you wish to monitor when connected to the office wireless network or the VPN:

$ ssh backend-1.backend.staging -CNL 9000:

Or on AWS:

$ ssh $(ssh integration "govuk_node_list --single-node -c backend").integration -CNL 9000:

or using govuk-connect:

$ brew install alphagov/gds/govuk-connect
$ gds govuk connect sidekiq-monitoring -e production aws/backend 

Then visit to see a list of Sidekiq configurations you can monitor.

Sidekiq Grafana Dashboard

You can also monitor Sidekiq queue lengths using this Grafana dashboard. It is available in all environments.

See also: Add sidekiq-monitoring to your application.

Sidekiq from the console

Where possible you should use Sidekiq’s web interface or Grafana to view Sidekiq stats and queues. SSHing into machines to interrogate things should be a last resort.

Sidekiq exposes a rich API which can be queried from the rails console.

The Stats class gives a nice overview.

# => #<Sidekiq::Stats:0x00007fbdf0ac4a30 @stats={:processed=>114999987, :failed=>15129, :scheduled_size=>22741, :retry_size=>1, :dead_size=>0, :processes_size=>3, :default_queue_latency=>10162.526781797409, :workers_size=>90, :enqueued=>1508687}>

# => {"delivery_immediate_high"=>949953, "default"=>451201, "delivery_immediate"=>101006, "email_generation_immediate"=>0, "email_generation_digest"=>0, "cleanup"=>0, "process_and_generate_emails"=>0, "delivery_digest"=>0}

You can also query and iterate through the Queues directly:


# => [#<Sidekiq::Queue:0x00007fe98b133590 @name="cleanup", @rname="queue:cleanup">, #<Sidekiq::Queue:0x00007fe98b133518 @name="default", @rname="queue:default">, etc...

Sidekiq::Queue.all.collect {|q| [, q.size] }

# => [["cleanup", 0], ["default", 0], ["delivery_digest", 0], ["delivery_immediate", 0], ["delivery_immediate_high", 0], ["email_generation_digest", 0], ["process_and_generate_emails", 0]]

Retry logic

Sidekiq has in built retry logic (turned on by default, but configurable). Middleware is used to send metrics (successes, failures, job timings and retry counts) to statsd, which forwards the data to Graphite to be stored.

Jobs do fail, this is not inherently bad and can happen for a number of reasons. When a job fails it gets retried with an exponential backoff (up to 21 days), as long as retries are enabled. A high number of retries signifies a bigger, less transient problem maybe occurring.

This page was last reviewed on 14 July 2019. It needs to be reviewed again on 14 January 2020 by the page owner #govuk-developers .
This page was set to be reviewed before 14 January 2020 by the page owner #govuk-developers. This might mean the content is out of date.