jondot / sneakers

A fast background processing framework for Ruby and RabbitMQ
https://github.com/jondot/sneakers
MIT License
2.24k stars 333 forks source link

[Question] ELI5 - how does 'threads' and 'prefetch' works in sneakers? #438

Open zulhfreelancer opened 4 years ago

zulhfreelancer commented 4 years ago

I'm new to RabbitMQ and sneakers gem. I read the Wiki and I saw 'threads' and 'prefetch' config.

I don't really get how they worked in sneakers and what's the best value should be set in my environment.

Currently I set the 'threads' to 2 and leave the 'prefetch' to default (not sure what's the default really). Upon launching sneakers process (bundle exec rake sneakers:run), my RabbitMQ server was steady and healthy.

Leaving that sneakers process running in terminal A, I ran rails s in terminal B and I quickly noticed my RabbitMQ server became unhealthy and took a while to get back to healthy state again.