Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can multiple sidekiq instances process the same queue

Tags:

I'm not familiar with the internals of Sidekiq and am wondering if it's okay to launch several Sidekiq instances with the same configuration (processing the same queues).

Is it possible that 2 or more Sidekiq instances will process the same message from a queue?

UPDATE:
I need to know if there is a possible conflict, when running Sidekiq on more than 1 machine

like image 570
Jacob Avatar asked Nov 03 '12 21:11

Jacob


People also ask

Is Sidekiq multithreaded?

Sidekiq handles concurrency by using multiple threads in its process. This way, it can process multiple jobs at once, each thread processing one job at a time. By default, Sidekiq uses 10 threads per process.

How does Sidekiq queue work?

Sidekiq server process pulls jobs from the queue in Redis and processes them. Like your web processes, Sidekiq boots Rails so your jobs and workers have the full Rails API, including Active Record, available for use. The server will instantiate the worker and call perform with the given arguments.

Is Sidekiq a queue?

Out-of-the-box Sidekiq uses a single queue named "default," but it's possible to create and use any number of other named queues if there is at least one Sidekiq worker configured to look at every queue.

What is Sidekiq queue latency?

Method: Sidekiq::Queue#latency Calculates this queue's latency, the difference in seconds since the oldest job in the queue was enqueued.


1 Answers

Yes, sidekiq can absolutely run many processes against the same queue. Redis will just give the message to a random process.

like image 60
Mike Perham Avatar answered Sep 22 '22 21:09

Mike Perham