# Logstash 6.4.2 High CPU usage while running a conf file

**URL:** <https://discuss.elastic.co/t/logstash-6-4-2-high-cpu-usage-while-running-a-conf-file/166161>\
**Category:** Logstash\
**Created:** [January 29, 2019, 12:12pm UTC](https://discuss.elastic.co/t/logstash-6-4-2-high-cpu-usage-while-running-a-conf-file/166161 "2019-01-29T12:12:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bharatbhushan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharatbhushan/32/10960_2.png) [@bharatbhushan](https://discuss.elastic.co/u/bharatbhushan)\
**Post date:** [January 29, 2019, 12:12pm UTC](https://discuss.elastic.co/t/logstash-6-4-2-high-cpu-usage-while-running-a-conf-file/166161/1 "2019-01-29T12:12:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [January 29, 2019, 12:26pm UTC](https://discuss.elastic.co/t/logstash-6-4-2-high-cpu-usage-while-running-a-conf-file/166161/2 "2019-01-29T12:26:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 26, 2019, 12:26pm UTC](https://discuss.elastic.co/t/logstash-6-4-2-high-cpu-usage-while-running-a-conf-file/166161/3 "2019-02-26T12:26:51Z")

</div>

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