Search code examples
ruby-on-railsmultithreadingcapistranopuma

Rails 4 Puma concurrency with Capistrano


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.


Solution

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