0

I am trying to deploy a concurrent Rails 4 Puma app with capistrano and was confused by the example of capistrano-puma gem.

From the snipper from github

set :puma_threads, [0, 16]
set :puma_workers, 0
  1. What are the differences of threads and workers in puma?
  2. What does 0 puma worker means and [0, 16] threads mean?
  3. What are the parameters to achieve concurrency? My aim is to achieve simple SSE to send notification. What are the best parameters to do in puma?

I am sorry if these are simple questions but i am having hard time finding resources online even on the official site, if someone can point me to an article which answer my question, i am happy to accept it. Thanks.

user793789
  • 196
  • 1
  • 13
  • 1
    Possible a duplicate of http://stackoverflow.com/questions/24280743/what-is-the-difference-between-workers-and-threads-in-puma – quazar Nov 04 '16 at 07:51
  • not a duplicate, there is no explanation if deploy script of capistrano override puma config (or if cero means unlimited workers like the answer) – Gonzalo S Aug 07 '18 at 05:44
  • @user793789 Have you got answer ? – sunil Aug 26 '21 at 10:26

2 Answers2

1

Tho not found in any documentation, I suppose set :puma_workers, 0 would means unlimited puma workers.

user793789
  • 196
  • 1
  • 13
0

A worker is the number of processes running or instances of your application. Each instance can run multiple threads. So if you have 2 workers running with max 16 threads it means your server can serve 2 * 16 = 32 requests at a time and if avg response time of your request is 100ms it means per second requests that could serve = (1000/100) * 32 = 320rps approx.