My project requires both Rails and Java for special scaling ability.
We firstly started a pure JRuby on Rails project, and deploy it to Tomcat. The problem is our Tomcat server has a very limited resource with only 20-30 threads. It means that our web app can only concurrently serve 20-30 users at a time.
We plan to improve the throughput by converting some heavy synchronous code to evented-code by using EventMachine. With evented-code a single thread can do more work instead of waiting for a long-time job to finish.
But to use EventMachine, the web server must be event-based, while Tomcat is not the case.
It seems there is no hybrid multi-threaded and evented solution in JRuby/Tomcat, so we decide to combine the asynchronous support in Servlet 3.0 with our current Rails app. Some parts of the code will be written in Java with Servlet library. It sounds crazy, but we think it's the most suitable for us.
Is there anyway I can do that with JRuby Rails, Warbler and Java Servlet 3.0 ?
Thanks for all your interest. Any suggestion is very appreciated.