Logstash 6.4.2 High CPU usage while running a conf file

Hi All,

i am running single Logstash conf file with simple code. but every times cpu is reached to full usage ( all cpu is upto 100%). While starting Logstash conf file, Cpu is increasing.

Conf file is below mentioned

File name is test.conf

input {
	file {
		"path" => "/home/bharat/input.txt"
	}
}

output {
	file {
		"path" => "/home/bharat/output.txt"
	}
}

And I run the command below mentioned

sudo /usr/share/logstash/bin/logstash -w 1 -f /etc/logstash/conf.d/test.conf

After run command i got message

    WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Sending Logstash logs to /usr/share/logstash/logs which is now configured via log4j2.properties
[2019-01-29T17:50:41,294][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-01-29T17:50:42,374][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"6.4.2"}
[2019-01-29T17:50:46,352][INFO ][logstash.pipeline        ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>1, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2019-01-29T17:50:46,655][INFO ][logstash.inputs.file     ] No sincedb_path set, generating one based on the "path" setting {:sincedb_path=>"/usr/share/logstash/data/plugins/inputs/file/.sincedb_a81e3974f3d9ecad2a867dfc25163824", :path=>["/home/bharat/input.txt"]}
[2019-01-29T17:50:46,694][INFO ][logstash.pipeline        ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x224a7ad3 run>"}
[2019-01-29T17:50:46,774][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2019-01-29T17:50:46,837][INFO ][filewatch.observingtail  ] START, creating Discoverer, Watch with file and sincedb collections
[2019-01-29T17:50:47,379][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9601}

After got Successfully started Logstash API endpoint, CPU usage is on normal state.

My use case is that i run logstash file via cron, means that it start logstash conf file as a new pipeline.

Please Help me.

I think this is normal. During start up many things are happening. The JVM, Log4J and JRuby (compiling) are initialising. Logstash is loading and checking many subsystems.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.