# High CPU Usage by logstash processes

**URL:** <https://discuss.elastic.co/t/high-cpu-usage-by-logstash-processes/93697>\
**Category:** Logstash\
**Created:** [July 19, 2017, 6:15am UTC](https://discuss.elastic.co/t/high-cpu-usage-by-logstash-processes/93697 "2017-07-19T06:15:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mruthyu](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mruthyu](https://discuss.elastic.co/u/mruthyu)\
**Post date:** [July 19, 2017, 6:15am UTC](https://discuss.elastic.co/t/high-cpu-usage-by-logstash-processes/93697/1 "2017-07-19T06:15:37Z")

</div>

When the logstash process is consuming high CPU cycles and CPU usage shoots up to more than 100%. The server is a 2 core machine. The standard GROK filters have been used to process the log files. There are 3 set of GROK filter lines to parse 3 types of log events. Input is from Kafka broker.

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [July 19, 2017, 6:59am UTC](https://discuss.elastic.co/t/high-cpu-usage-by-logstash-processes/93697/2 "2017-07-19T06:59:31Z")

</div>

Run logstash again and then do below  
$ vmstat 1

Please show me the output

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 19, 2017, 7:51am UTC](https://discuss.elastic.co/t/high-cpu-usage-by-logstash-processes/93697/3 "2017-07-19T07:51:56Z")

</div>

Please also show the configuration and what the grok expressions look like. Logstash is often limited by CPU, so having it max out CPU usage is not necessarily a problem, just a sign it is working hard. Inefficient grok patterns can however consume a lot of CPU, so you may want to go through and optimise them

---

<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:** [August 16, 2017, 7:52am UTC](https://discuss.elastic.co/t/high-cpu-usage-by-logstash-processes/93697/4 "2017-08-16T07:52:07Z")

</div>

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