Search code examples
ruby-on-railsmultithreadingthread-safetypumaapplication-server

Question about thread-safety and disabling multi-threading with Puma


The Puma readme states the following: "Be aware that additionally Puma creates threads on its own for internal purposes (e.g. handling slow clients). So, even if you specify -t 1:1, expect around 7 threads created in your application."

Suppose that my Rails app is not thread-safe, and as such I need to prevent the app from being multi-threaded. Let's say I use Puma and specify -t 1:1 to try configure this. Is there any thread-safety-related reason for me to be concerned that Puma will still create threads on its own for internal purposes? I think the answer is probably no, but I'm asking here to be sure.

I asked this same question in a GitHub issue as well.


Solution

  • The GitHub issue received the following answer and was marked as completed:

    No, these threads don't interact with your app in any way, and only one thread will ever run your application code, ever, with no concurrency.