I would strongly encourage you to do two things:
Read Using JRuby http://pragprog.com/book/jruby/using-jruby . You
work though it quickly and the examples and material contained in it
give you some ideas about how you can use JRuby to improve the
of your clients app. You might also want to check out Deploying
JRubyhttp://pragprog.com/book/jkdepj/deploying-with-jrubyas it has a
lot of useful information about some of the main deployment
Spend some time reading through articles on the JRuby
wikihttps://github.com/jruby/jruby/wikias they should provide a way
to deepen the knowledge gleaned from the book,
without requiring you to spend too much time on any of them.
This should give you a better idea about JRuby, and the how and why it
typically used by other developers. This video, Why JRuby
some of this reasoning as well, and might be an even better
It might be the case that you could switch the rails app to JRuby, have
run with very few changes, and get an immediate performance boost simply
due to JRubys better performance. The material I recommended will
assuredly instruct you in how to do this.
As for going asynchronous, it might be possible to use the Play
via JRuby, to build an asynchronous application. I dont know of anyone
has done that, personally, although it has probably been tried. You
just take a rails app, suddenly slap in JRuby and Play and have it be
asynchronous however. Rails and Play are each frameworks in their own
right, and Im not even sure where one would begin to hook them together.
Usually, when people talk about asynchronous code in conjunction with
Rails, they mean running selected parts of the Rails stack in an
asynchronous way. Typically I/O heavy parts. Most often, they mean
it with an asynchronous server.
The two libraries most typically used to do async programming in Ruby
EventMachine http://rubyeventmachine.com/ and
specifically Celluloid I/O https://github.com/celluloid/celluloid-io.
those two, Id most highly recommend Celluloid, for many reasons, but
especially because it doesnt just give you Celluloid I/O for writing
asynchronous code, but instead Celluloid provides an entire concurrency
toolkit built around the Actor model. (Play framework is also built on
of the Actor model abstraction, but I believe Play hides this all from
instead of making it available to the end user).
Probably your easiest option for adding some async sauce to a Rails app
would be to swap out the server for one written with one of those two
libraries I mentioned above. Id suggest
That said, you might get better improvements just switching to JRuby
the native threading capability and then using something like
Pumahttp://puma.io/which is specifically intended for use in Rack
applications like those
built with Rails, or one of the other deployment options recommended in
book I mentioned. TorqueBox http://torquebox.org/ would be another
It will depend on your clients use case, and you should definitely try
several things and do some benchmarking.