Pregunta

I am new to Sidekiq and use it with Ruby on Amazon EC2 instances to do some work using ImageMagick with images.

While running it I realized that every worker runs on the same core. I use EC2 c3.2xlarge machines and they have 8 cores. It shows CPU usage is 15% but one core used 100%, and the others are using 0%.

Can Sidekiq use different CPU cores for different workers? If it can, is this inefficiency caused by ImageMagic and how can I make it to use other cores?

¿Fue útil?

Solución

If you want to utilize multiple cores using MRI, you'll need to start multiple Sidekiq processes; having multiple threads configured for your sidekiq instance is not enough.

So if you wanted to use all 8 cores, you would start 8 processes. They will all feed off of the same queue, so there's no need to worry about jobs being processed multiple times.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top