3 ms·
We were "IO-bound" using a setup that executed a maximum of two requests at a time, completely blocked processing new requests until earlier ones fully complete
by strken 6y ago
We were "IO-bound" using a setup that executed a maximum of two requests at a time, completely blocked processing new requests until earlier ones fully completed, and took a long time to execute requests because of unexpected latency in a dependency, while 20 frustrated users sat in a room hammering the refresh button and dumping more tasks onto the queue.
You're absolutely right when you say there was something seriously wrong with the setup! The problem is that it was more or less what you'd get if you set up a default Rails app behind Passenger, and Passenger did this because some of the major Ruby gems weren't threadsafe (e.g. Rails, until 2008), which comes back to concurrency problems with the ecosystem.
- darwinwhy 6y agoWhat is Passenger exactly? Never heard of it before now. A quick Google brings up a marketing page that doesn't explain much more.
- johnmcauley 6y agoIt’s a Ruby web server that can we bed used with nginx or Apache.
- universa1 6y agoSomething like mod_perl / mod_xxx in the early days... and they did some work on the concurrency problems with rails and ruby around the ruby 1.8 days iirc... In the meantime they expanded to more languages...
- ForHackernews 6y agoIt's an application server. If you're familiar with the Python webdev ecosystem, Passenger is roughly a Ruby equivalent for something like uWSGI or Gunicorn. (IIRC, you can actually run Python apps with Passenger now, too)
- coldtea 6y agoWhere now = for 5 years or more.
- e12e 6y agoNot sure if you mean this page or not: https://www.phusionpassenger.com/ https://www.phusionpassenger.com/ But as they say, it's an application server. Similar to mod_perl for apache/php, unicorn or indeed nodejs (which can function as an application server for Javascript).
- jacobsenscott 6y agoIf you were IO bound you could have run many more rails processes. There's no reason to limit your self to one process per core. You can run many times that number of processes since they are all just waiting on IO.
- EdwardDiego 6y agoI'm sure the original commenter is loving all your 20/20 hindsight.
- coldtea 6y agoThe original commenter offered his story as an issue with Ruby preventing X. The 20/20 hindsight is not meant to retroactively solve their problem, it's mean as a counter-argument, that the problem was their design, not Ruby.
- Person5478 6y agoThe posters point is that Ruby has surprising concurrency semantics compared to other solutions.
- Evan__ 6y agoIt has the same concurrency semantics w/r/t IO as any other language that isn't using an event based runtime. If you wrote your app in C and used a single thread you'd have the exact same issue.
- kevincox 6y agoRuby should be able to execute more than one request on a time because while it can only have one thread executing Ruby at a time it can run other threads while waiting for IO. It seems like for some reason Rails was limited to one thread which is not how it should be configured.