jondot / sneakers

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

Is there some potential issues if setting single worker but multi-thread in prd env? #461

Closed TDtianzhenjiu closed 2 years ago

TDtianzhenjiu commented 2 years ago

As the title described I found multi-process take too much mem

In general, multi-process improves the system’s reliability, in order to save mem I want to set single worker and multi-thread, it also consumes and processes MQ message parallelly.

But I'm not sure whether single workers will cause other issues?

michaelklishin commented 2 years ago

Any shared state your code introduces, you'd have to synchronise. Sneakers relies on Bunny, and in Bunny sharing channels between threads is a no-no by design. Besides that, there isn't anything obvious that I can think of.

Running your actual workload in a different mode is the best way to find out how compatible and ready it is for the switch.

michaelklishin commented 2 years ago

@jondot can we enabled Discussions for this repo so that we can convert issues that are questions to discussions?