

I'd rather Go complain about Rails - alediaferia
http://thread0.me/2015/05/id-rather-go-complain-about-rails/

======
annon
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...](https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html#_resource_control_and_optimization_options)

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
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.

------
pjmlp
TL;DR; Native code generation implementation of programming language A
outperforms interpreter implementation of programming language B.

~~~
shitlord
And somehow, by using Go, he managed to plug a resource leak.

~~~
josegonzalez
He also didn't need to load the entire rails stack, allowing him to have
better memory perf in his application.

------
radiospiel
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.

------
andrewvc
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.

~~~
15155
And there are many experienced "Rubyists" who refuse to concede that Rails
isn't good at absolutely everything under the sun.

~~~
andrewvc
And 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

