Logstash: Question: Steps to run Logstash with native Ruby and not JRuby

Created on 13 May 2015  路  6Comments  路  Source: elastic/logstash

Hi,

I'm hoping to use logstash on a small server limited to embedded Java and 512M of RAM... And I can! It's just very slow start-up and sucks up a lot of resource that I need elsewhere.

I would like to use native Linux Ruby instead of JRuby to, hopefully, free up resources... So, I am setting USE_RUBY=1... but _runner.rb_ dies at line 46:
kernel_require.rb:56:in 'require': cannot load such file -- i18n (LoadError)

I'm guessing that this is a path issue GEMS_HOME and GEMS_PATH and that there is interplay between logstash and the native Ruby libs. As I neophyte w.r.t. Ruby, could someone point me to a guide or point out some other doc that could point the way so that I have a stable install, even though I am aware of the date and ES limitations.

Thanks!

All 6 comments

@technosf USE_RUBY=1 will in fact use you current ruby interpreter but note that we currently do not support non-JRuby interpreters. USE_RUBY=1 is more intended for development mode when you want to test with a different local JRuby version for example.

If you have limited resources, you can tweak the maximum logstash heap size which is 500M by default, you could set it to 256M with LS_HEAP_SIZE=256m.

The memory is pegged down, as you suggest @colinsurprenant, but it's the CPU utilization that is my focus. Being able to try native Ruby would have been informative.

it's the CPU utilization that is my focus

MRI is, for general performance, slower than JRuby in most thing I use. MRI's startup time is faster, but once JRuby gets going (15-30 seconds warmup), it's often 1.5 to 2x faster, if not more. I won't discourage experimentation, though!

When I was fiddling with MRI yesterday, I found I could get Logstash under MRI mostly working, at least for plugin testing, by using MRI to build the elastic/logstash-devutils gem and the logstash-core gem from elastic/logstash, then installing them in MRI. Hope this helps you get started :)

Oops, Didn't mean to close :)

Commenting out the JRuby checks in devutils and I have, in local gems:

bundler (1.9.9, 1.9.7)
logstash-core (2.0.0.dev)
logstash-devutils (0.0.13)

etc.

Stuck on _bundler_ - tried flipping a few switches in _bundler.rb_, but it's beyond my current ken of Ruby - guessing it's a path issue (I'm playing this out on windoze right now).

cannot load such file -- bundler (LoadError)
kernel_require.rb:56:in `require`
bundler.rb:29:in `setup!'
environment.rb:46:in `<main>'

Thanks for your help Jordan.

At this point only JRuby is supported for development and production.

Was this page helpful?
0 / 5 - 0 ratings