-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logstash v1.5.4 misleading error message when heapsize is too small #3817
Comments
The error message is so bizarre. Not sure why it does not throw an OOM exception. Related #3400 |
The config is pretty simple too. input { filter { metrics { |
@TinLe it depends on the size of your events because the default bulk size from LS to ES is 5K! That may work when your logs are 300 bytes a pop, but will quickly blow up when its bigger. A defensive step we are taking is to reduce the default to 500 instead of 5k in the next release. @TinLe You can try going back to 1 GB heap, but reduce the |
@suyograo Yes, I am still getting that exception error in the log, and then it seem to stop consuming, although logstash process is still around. I tried 1GB heap, no good. Reduced flush_size to 1K, no good. Increased heap to 2GB, still exception. Now running at 2GB heap AND reduced flush_size to 100. So far stable last hour or so. |
@TinLe interesting, whats the avg size of your events/docs? |
Approx 4KB. |
@TinLe another point that @talevy pointed out, you are using elasticsearch input -- we just fixed a bug in this plugin to reduce the memory usage.. logstash-plugins/logstash-input-elasticsearch#21 We'll have a version published soon with that patch. It should help |
@TinLe would you be willing to test this patch? logstash-input-elasticsearch v1.0.1 has been released with the memory consumption fix
|
Yep. That seem to have fixed it. I tested with 2GB and 1000 flush_size, works well for 10minutes. So tried again with 1.5GB and 1000 flush_size, still running. Memory usage seem to be lower too. :-) |
yay! nice work @talevy ! 🏆 |
thanks @TinLe for trying it out! |
While the issue is solved for @TinLe, there is still the unsatisfactory error message for the conditions described above. |
@guyboertje do you have any ideas on how to catch this situation within jruby and handle it appropriately? I agree, we should catch this and supply users with a better message. |
+100 on providing better feedback to users when OOM happens. |
this stackoverflow question and this JRuby issue points to the problem. With JRuby 1.7.22 and above this particular error should not occur. But it raises the next question. What is the exception raised in the thread that causes it to stop? Probably java.lang.OutOfMemoryError in that thread but which JVM section is out of memory? We will only know if we rescue and log it (will that even work if we are OOM?). However according to this JRuby issue, with Here in [this stackoverflow question]9http://stackoverflow.com/questions/2679330/catching-java-lang-outofmemoryerror) and this answer in particular provide more insights. Epic research even if I say so myself! |
Are we likely to see a LS 1.5.5 release that has been updated from JRuby 1.7.20 to 1.7.22 or will we need to use LS 2.0? |
@jstangroome - LS v1.5.4 does have JRuby 1.7.22. I was (badly) stating my surprise that the original poster got this UnsupportedOperation error in in LS 1.5.4 (1.7.22). I need to create a OOM generating input, codec, filter and output and test how we respond to these conditions. We cannot guarantee that we will back port any improvements made in 2.0 in this regard to 1.5.5. @ph see this line from JRuby specs WDYT? |
@jstangroome - correction to above comment. You correctly point out here that LS 1.5.4 has 1.7.20 |
@jstangroome we will be shipping 1.5.5 with JRuby 1.7.22 and other fixes soon. |
I think we have this covered now. |
If logstash is started with too small of a heap, it barfed with misleading error message. Fortunately, I just changed one value, so I knew exactly what broke.
I had LS_HEAP_SIZE=2000m and lowered it to 1000m, when logstash is started, the log contain:
Exception in thread "|worker" Exception in thread "<elasticsearch" java.lang.UnsupportedOperationException
at java.lang.Thread.stop(Thread.java:869)
at org.jruby.RubyThread.exceptionRaised(RubyThread.java:1221)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:112)
at java.lang.Thread.run(Thread.java:745)
java.lang.UnsupportedOperationException
at java.lang.Thread.stop(Thread.java:869)
at org.jruby.RubyThread.exceptionRaised(RubyThread.java:1221)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:112)
at java.lang.Thread.run(Thread.java:745)
Changing the LS_HEAP_SIZE to 1500m allows it to run again. So evidently, I lowered it too much.
The text was updated successfully, but these errors were encountered: