You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just tried puma on a rails 3.1.1 app. I added 'config.threadsafe!' to 'config/environments/production.rb' and get the following output when I boot the app:
⚡ RAILS_ENV=production bundle exec puma --threads 0:3
Puma 0.9.1 starting...
* Min threads: 0, max threads: 3
* Listening on tcp://0.0.0.0:9292
Use Ctrl-C to stop
I then created a controller action that looks like this:
def index
product.connection.select_all("select sleep(10)")
render :text => "I should have taken 10 seconds! (id: #{Thread.current.object_id})"
end
If I make 2 concurrent requests they seem to execute serially and the thread ID is identical. Am I missing something?
The text was updated successfully, but these errors were encountered:
That's odd. Could you replace the 2nd line with just "sleep 10" and see what happens?
Perhaps
a) you're on MRI 1.8 or 1.9 and
b) the database adapter you're using uses a C extension (likely) and
c) the C extension doesn't release the GVL nor does it use rb_thread_select (likely)
I've just tried puma on a rails 3.1.1 app. I added 'config.threadsafe!' to 'config/environments/production.rb' and get the following output when I boot the app:
I then created a controller action that looks like this:
If I make 2 concurrent requests they seem to execute serially and the thread ID is identical. Am I missing something?
The text was updated successfully, but these errors were encountered: