I am working on a Ruby on Rails application that is currently hosted on Heroku. We have about 5 web speakers and about 2 workflows that work on average. But since we use adeptscale , this can change a lot, and the cost increases every month.
We are thinking about changing the process and infrastructure (using our own, with amazon / google, etc.). And also because of performance, access to java libraries and other benefits that we plan to use with jRuby.
I don't have much experience with jRuby at all, but I have Java experience. So I have a few questions:
Intro question: Since the philosophy / approach of rails is different from Javas, i.e. The ruby โโweb server uses much less memory, but can only process one request at a time, and therefore having multiple servers compensates for the inability to process multiple requests.
- If we move on to jRuby (and our rails project is packaged as a war file and deployed to any servlet container, that is, Tomcat or Jboss (more than just a container)), then can we handle several requests?
Question: At present, we have some kind of applied logic working in workers (instead of blocking the web server and the inability to serve other clients / clients of the browser). those. when users submit some form, and then our application needs to contact a third-party service to return a response, we just let the employee do the work of returning from the third-party service and update the ui (which reports the waiting status) via websockets that the third-party service returned x / y or any other status.
- If we move on to jRuby, how do we get this logic? I mean, what do we go with Java code that has some kind of pool of worker threads, and then free workers do the workload of communicating with a third-party service, etc.? How do we do this if we decide to go with jRuby?