On Mar 8, 4:46am, snacktime [email protected] wrote:
I seem to remember from somewhere you guys used ruby, not that many of
us in the gaming world yet.
I can’t really talk specific numbers too much, but daily requests
served by jruby right now is tens of millions per day, will probably
pass the 100’s of millions within a week or so. We use rails under
tomcat 7.
Wow, that’s really excellent. When I started reading, I thought you
must have to be using something light like Sinatra, but this kind of
performance with Rails is great. Which version of Rails are you using?
Performance wise we can push close to 700 requests per second on a
single xeon server. Of course that number is all relative to the
hardware and the application, but this is not a simple application by
any means. One interesting thing we found is that in general, jruby
performs closer to pure java performance then I would have thought.
Close enough that it’s generally not a big win going with native java
libraries. There have been a few exceptions, like ditching net-http
to use an http client that uses Grizzly, and making use of some of the
java.util.concurrent stuff, but for the most part we just do
everything in ruby.
I’d like to hear about the Grizzly client. This is a common problem
people have with the Ruby HTTP client libraries…they either suck, or
they’re a C extension (suck^2). It would be nice to end the problem
for JRuby users once and for all by doing a light JRuby extension
around “the best” Java HTTP client. It should be screaming fast then.
The biggest issue we have had is getting used to using threads. The
jruby guys fixed a couple of performance related threading issues (
and did it really fast I must say), but most of our threading issues
were completely outside jruby. A gem here and there that was thread
safe but used a giant lock around everything. Some standard java
libraries that lock aggressively. I’m still hunting down thread locks
in our app. But it’s not that bad because java gives you the tools to
identify this kind of thing without much effort.
How are you approaching the external gems? Because threading is a
primary raison d’tre for JRuby, we work hard on issues you report to
us…but I am also interested in helping to “teach the world to sing”
by patching libraries that do too little or too much synchronization.
One thing that does hurt is when you need to go to C. The jruby ffi
is great as far as ease of use, but you take a pretty big performance
hit compared to cruby extensions. In our case we were looking at
using zeromq for communicating between threads, but the performance
hit was just too much. On the flip side, there are fewer cases where
you need to go to C because you have access to java, and calling out
into native java libraries doesn’t seem to be that expensive.
We’ve heard from others that FFI is actually pretty good in comparison
to C exts, and the MQ libs were one of the prime examples. Do you
have something we can use to reproduce the poor performance? We’re
always trying to speed up FFI, since it is (or needs to be) the future
of integrating with C from Ruby.
Thanks for this update…it’s great to hear that JRuby’s working out
so well for you