Hacker News new | ask | show | jobs
by annon 4056 days ago
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

1 comments

Tried EventMachine in the past but not with this particular use case. Actually my nginx+passenger configuration allowed for 12 workers, but I may have counted wrong the running instances at the time of the deadlock. Anyway, what is interesting to me is trying to understand how actually Rails handles and releases MySQL connections. In fact, even with the timeout dance I implemented I didn't seem to succeed in releasing MySQL connections.