We're running a threaded ruby server (Puma), and have seen serious performance issues with our Sinatra app. Specifically, something as simple as Thread.pass
can take over 2s. How is it possible that a server with 16 threads can take over 2s to return control to a thread? Is the Ruby scheduler that bad, or is there something we can do to fix this?
Details:
- Ruby implementation: MRI 2.1
- Sinatra App
- Running on Heroku 1x dynos
- Puma server, running 16 threads, 1 process
- Some routes are doing fairly heavy work, but routes doing almost no work are impacted
- Over 100MB in free memory
Thanks in advance!