puma / puma

A Ruby/Rack web server built for parallelism

Home Page:https://puma.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about thread-safety and disabling multi-threading

DanielStevenLewis opened this issue · comments

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 question on Stack Overflow too here.

Is there any thread-safety-related reason for me to be concerned that Puma will still create threads on its own for internal purposes?

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.