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: https://www.phusionpassenger.com/documentation/Users%20guide...
I wouldn't recommend the approach you are taking if you wanted to build this in ruby. Have you looked in to Event Machine? https://github.com/eventmachine/eventmachine