3

I'm using rails5.2. For testing i've created below controller.

class IndexController < ApplicationController
    def index        
        sleep(10)
        render text: "done"
    end
end

If I make 5 parallel requests, 1st request takes 10s, 2nd takes 20s, 3rd takes 30s and so on..

myAppRails5 aravind$ bin/rails server
=> Booting Puma
=> Rails 5.2.0 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.11.4 (ruby 2.5.1-p57), codename: Love Song
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

Puma configuration : Min threads: 5, max threads: 5 Rails 5.2.0 application starting in development

development.rb

puma.rb

As per puma doc, threaded is supported. How do I achieve multi threading here?

Hideandseek
  • 271
  • 1
  • 4
  • 17

0 Answers0