# Logstash 6.2.2 high CPU usage

**URL:** <https://discuss.elastic.co/t/logstash-6-2-2-high-cpu-usage/122672>\
**Category:** Logstash\
**Created:** [March 6, 2018, 8:47am UTC](https://discuss.elastic.co/t/logstash-6-2-2-high-cpu-usage/122672 "2018-03-06T08:47:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JulianYuan](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@JulianYuan](https://discuss.elastic.co/u/JulianYuan)\
**Post date:** [March 6, 2018, 8:47am UTC](https://discuss.elastic.co/t/logstash-6-2-2-high-cpu-usage/122672/1 "2018-03-06T08:47:12Z")

</div>

I upgraded Elastic Stack from 5.6.3 to 6.2.2, but the Logstash CPU usage go high and no error logs.

**Start command:**

`./logstash -f '/data/conf/main.conf' -l /data/logs/logstash/`

**Logstash config:**

```
input {
  beats {
    port => 5044
    add_field => {
      "logstashId" => "logstash1"
    }
  }
}

output {
  elasticsearch {
    action => "index"
    hosts => ["localhost:9200"]
    index => "test-%{+YYYY.MM.dd}"
    manage_template => false
    template_overwrite => true
    document_type => "%{[@metadata][type]}"
  }
}

```

**Logstash stats:**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c710287cc8ef13dc3a1848ea79fd6f86ac4cd96f.png)

**$top**

```
top - 09:40:02 up 371 days, 3 min, 2 users, load average: 1.74, 1.49, 1.28
Tasks: 190 total, 1 running, 189 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.5 us, 0.1 sy, 0.0 ni, 99.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 20396440 total, 8862336 free, 6573776 used, 4960328 buff/cache
KiB Swap: 16515068 total, 15727996 free, 787072 used. 13406740 avail Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
26113 admin 20 0 11.969g 1.453g 20304 S 100.0 7.5 1119:41 java
    1 root 20 0 74020 35220 1332 S 0.0 0.2 6:19.52 systemd
    2 root 20 0 0 0 0 S 0.0 0.0 0:04.59 kthreadd

```

**$ top -H -p 26113**

```
top - 09:40:18 up 371 days, 3 min, 2 users, load average: 1.53, 1.46, 1.27
Threads: 64 total, 1 running, 63 sleeping, 0 stopped, 0 zombie
%Cpu(s): 26.0 us, 1.8 sy, 0.0 ni, 72.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 20396440 total, 8861800 free, 6574300 used, 4960340 buff/cache
KiB Swap: 16515068 total, 15727996 free, 787072 used. 13406216 avail Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
26154 admin 20 0 11.969g 1.453g 20304 R 96.3 7.5 993:23.30 LogStash::Runne
26126 admin 20 0 11.969g 1.453g 20304 S 2.7 7.5 24:44.55 java
26127 admin 20 0 11.969g 1.453g 20304 S 2.7 7.5 24:44.69 java
26128 admin 20 0 11.969g 1.453g 20304 S 2.7 7.5 24:44.26 java
26129 admin 20 0 11.969g 1.453g 20304 S 2.7 7.5 24:44.46 java

```

What could be possible reason for high CPU usage?

---

<div class="post-metadata">

**Author:** ![jbillen](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jbillen](https://discuss.elastic.co/u/jbillen)\
**Post date:** [March 8, 2018, 10:04am UTC](https://discuss.elastic.co/t/logstash-6-2-2-high-cpu-usage/122672/2 "2018-03-08T10:04:45Z")

</div>

Do you have 'config.reload.automatic' set to 'true' in your logstash.yml?

Disabling the automatic config reload resolved the issue for us:

config.reload.automatic: false

---

<div class="post-metadata">

**Author:** ![JulianYuan](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@JulianYuan](https://discuss.elastic.co/u/JulianYuan)\
**Post date:** [March 9, 2018, 12:42am UTC](https://discuss.elastic.co/t/logstash-6-2-2-high-cpu-usage/122672/3 "2018-03-09T00:42:40Z")

</div>

Yes, I set 'config.reload.automatic' to 'true' in logstash.yml, but the root cause is not here.  
The value of "config.reload.interval" is not same between 5.6 and 6.2:

5.6:

> config.reload.interval : **3**

6.2

> config.reload.interval : **3s**

so it reload the config files all the time. after the value changed from '3' to '3s', the CPU usage go down.

---

<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:** [April 6, 2018, 12:42am UTC](https://discuss.elastic.co/t/logstash-6-2-2-high-cpu-usage/122672/4 "2018-04-06T00:42:52Z")

</div>

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