bluescreen303-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2011-Jan-17 11:27 UTC
multithreaded (threadsafe) not working for requests to the same url
Hi all, In my application, a lot of time is spent on /inbox. I''m running rails multithreaded (config.threadsafe) and verified this is working OK. However, it seems that requests to the same url, will block. Simple test app: ./script/generate controller slowdown action1 action2 def action1 sleep 15 end def action2 sleep 15 end and turn on config.threadsafe in config/environments/production.rb now run server in production mode open 3 browser tabs, enter these urls: - http://localhost:3000/slowdown/action1 - http://localhost:3000/slowdown/action1 - http://localhost:3000/slowdown/action2 You''ll see that if you start the requests roughly at the same time, the first action1 and action2 will complete at the same time. The second action1 comes 15sec behind. Passing non-used params (localhost:3000/slowdown/action1?blah=3) will trick the app to handle the request in parallel. Also, aliasing localhost does the trick. So it looks as if rails/rack does some locking per url. I couldn''t find anything though. Is anyone aware of this behavior? What is the cause? Thanks, Mathijs -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.