9 ms·
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
by annon 11y 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%20Nginx.html#_resource_control_and_optimization_options 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 https://github.com/eventmachine/eventmachine
- alediaferia 11y agoTried 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.