Discussion:
Performance gap between Ruby MRI and JRuby
Nicola Mingotti
2018-11-21 06:55:53 UTC
Permalink
Hi,

I just completed writing an application which substitutes FileBeat, for
our Elasticsearch stack.

I wrote it in Ruby 2.5.0, I considered it a good idea to move it under
JRuby because the server where it runs is not under my direct control.
Running it as JRuby would ensure me better protection against future
changes in the server software stack. The idea is: make a .jar of it and
close the story
once and for all.

Since the Java env. running in the server is not the newest I can
run there at best JRuby 9.1.17.0 (Ruby 2.3.3).

The point is, when i compare the performance on the server, from "top"
i see this:
--------------------
⇒ Ruby → 20-30% CPU, 1% mem
⇒ MRI Ruby → 4% CPU (stable), 0.1% mem
--------------------

In your opinion, is the gap due to the older Ruby version ? Is it
related to Java ?

Consier the code is the same, i simply run it either with "ruby" or "jruby".

bye
Nicola




Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bi
Nicola Mingotti
2018-11-27 00:26:53 UTC
Permalink
For whoever may be using JRuby,

I was able to spot the reason why JRuby was eating much more resources
than MRI: Threads. I was using a library making extensive use of them,
thousands.

Replacing the library with ad hoc code solved completely.

bye
n.
Post by Nicola Mingotti
Hi,
I just completed writing an application which substitutes FileBeat, for
our Elasticsearch stack.
I wrote it in Ruby 2.5.0, I considered it a good idea to move it under
JRuby because the server where it runs is not under my direct control.
Running it as JRuby would ensure me better protection against future
changes in the server software stack. The idea is: make a .jar of it
and close the story
once and for all.
Since the Java env. running in the server is not the newest I can
run there at best JRuby 9.1.17.0 (Ruby 2.3.3).
The point is, when i compare the performance on the server, from "top"
--------------------
⇒ Ruby → 20-30% CPU, 1% mem
⇒ MRI Ruby → 4% CPU (stable), 0.1% mem
--------------------
In your opinion, is the gap due to the older Ruby version ? Is it
related to Java ?
Consier the code is the same, i simply run it either with "ruby" or "jruby".
bye
Nicola
Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.r

Loading...