Ruby on rails with jRuby

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.

  1. 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?
+4
2

1) jruby , mri-ruby. - (config.threadsafe! rails4). . unicorn puma .

jruby, jboss tomcat, . , tourquebox, trinidad, . (, puma), c.

2) , ? sidekiq resque ruby โ€‹โ€‹ jruby ( jruby , ). ruby โ€‹โ€‹ jruby ( , rvm/rbenv)

, jruby, , , . , , , puma sidekiq . .

+5

- .war warbler. .war JRuby, 30 . , Warbler , , Rails Java.

, Rails , 5 - :) (, 16, IBM WAS - 50, Tomcat - 200).

smallbutton.com, - . , puma JRuby ( - )

+2

All Articles