Hello,
I have a problem with Logstash configuration. Its running with 500Xmx. When i tried to increase it in /etc/default/logstash to 1g
it doesnt take it into account after retasrting. But when i set LS_HEAP_SIZE to 1g
in /opt/logstash/bin/logstash.lib.sh it works.
How can i load configuration in default config file ?
Best reagards,
Nizar.
Which distribution and version? Are you using systemd?
I'm using 2.3.1, and it's not installed as a service, i runned it with /opt/logstash/bin/logstash agent -f qpa.conf.
/etc/default/logstash only matters when starting it as a service. If you're starting Logstash directly from your shell you can do this:
LS_HEAP_SIZE=1g /opt/logstash/bin/logstash agent -f qpa.conf
Thank you it's work.
And if I want to set to LS_OPTS="-w". I can set it with the same way ?
LS_OPTS="-w 8" LS_HEAP_SIZE=1g /opt/logstash/bin/logstash agent -f qpa.conf
Thank you.
And how can i chek if new LS_OPTS configuration taket into account ?
Check the actual command line with e.g. ps aux | grep logstash
.
Here is the output:
root 8242 149 1.5 5148100 257004 pts/3 Sl 11:31 1:53 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Xmx2g -Xss2048k -Djffi.boot.library.path=/opt/logstash-2.3.1/vendor/jruby/lib/jni -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/logstash/heapdump.hprof -Xbootclasspath/a:/opt/logstash-2.3.1/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/opt/logstash-2.3.1/vendor/jruby -Djruby.lib=/opt/logstash-2.3.1/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main --1.9 /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent -f qpa.conf
But i cant see the LS_OPTS option !!
Oh, wait. Silly me. To pass -w
when running it from your shell you obviously just pass that parameter (alongside -f
and whatever). LS_OPTS only matters when running it as a service, but LS_HEAP_SIZE, LS_JAVA_OPTS, and JAVA_OPTS are always picked up.
Thank you.
So is there any way to pass LS_OPTS in my case ? Or i have to install logstash as a service ?
Also, when i run logstash i have this message:
Defaulting pipeline worker threads to 1 because there are some filters that might not work with multiple worker threads.
What does it mean ?
So is there any way to pass LS_OPTS in my case ?
As I said, to pass -w
when running it from your shell you obviously just pass that parameter (alongside -f
and whatever). Is this unclear?
Or i have to install logstash as a service ?
Except for local testing you should never be running Logstash from your shell.
Sorry, i didnt understand at first. Now its clear.
Thank you
Can you explain to me why i get this message when i run logstash ?
Also, when i run logstash i have this message:
Defaulting pipeline worker threads to 1 because there are some filters that might not work with multiple worker threads.
What's unclear about it? I think it's a pretty explicit message.