3 ms·
I'd rather Go complain about Rails
- pjmlp 11y agoTL;DR; Native code generation implementation of programming language A outperforms interpreter implementation of programming language B.
- shitlord 11y agoAnd somehow, by using Go, he managed to plug a resource leak.
- josegonzalez 11y agoHe also didn't need to load the entire rails stack, allowing him to have better memory perf in his application.
- radiospiel 11y agoI 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.
- deleted 11y ago[deleted]
- annon 11y agoIt'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.
- andrewvc 11y agoThis 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.
- 15155 11y agoAnd there are many experienced "Rubyists" who refuse to concede that Rails isn't good at absolutely everything under the sun.
- deleted 11y ago[deleted]
- andrewvc 11y agoAnd there are people writing CRUD web apps in Go. There are plenty of developers who focus on the tools not expediently solving the problem for every stack. I wouldn't say this is a problem specific to ruby