It's stopping at 4 connected clients when running nginx+passenger because you are exhausting all the workers. You need to up the process limit if you are going to have workers that never complete their task for a long time, and then you need to worry about running out of memory if you have too many processes. Here's the passenger config information for that: <a href="https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html#_resource_control_and_optimization_options" rel="nofollow">https://www.phusionpassenger.com/documentation/Users%20guide...</a><p>I wouldn't recommend the approach you are taking if you wanted to build this in ruby. Have you looked in to Event Machine? <a href="https://github.com/eventmachine/eventmachine" rel="nofollow">https://github.com/eventmachine/eventmachine</a>
I am not really sure how Rails behaves these days behind an evented web server, and I also don't know if nginx+passenger offer such a setup; but I was running a similar application with Sinatra+Thin, which handled hundreds, if not thousands connections easily. Especially the number of 4 successful connections and then none make me suspect that something in the Rails setup was broken and/or that Rails still does not support long running requests.
This article is a bit absurd. Any experienced rubyist would tell you Rails sucks at this use case. Node/Go will absolutely kick ruby's ass here every day.