# Why does logstash consume CPU time in idle state?

**URL:** <https://discuss.elastic.co/t/why-does-logstash-consume-cpu-time-in-idle-state/89872>\
**Category:** Logstash\
**Created:** [June 19, 2017, 2:04am UTC](https://discuss.elastic.co/t/why-does-logstash-consume-cpu-time-in-idle-state/89872 "2017-06-19T02:04:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ka4ok85](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ka4ok85/32/19239_2.png) [@ka4ok85](https://discuss.elastic.co/u/ka4ok85)\
**Post date:** [June 19, 2017, 2:04am UTC](https://discuss.elastic.co/t/why-does-logstash-consume-cpu-time-in-idle-state/89872/1 "2017-06-19T02:04:31Z")

</div>

I push data to Logstash through Filebeat plugin on hourly basis, nothing else is transferred. My understanding is that during these idle periods Logstash should not consume CPU time. But it does although it is only 1%. I suspected GC, but looks like it's not related. Is there any chance I can fix this? Or is this expected behavior? Thanks.

```
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
  4760 ubuntu 20 0 2321164 200188 10200 R 1.0 19.7 7:08.73 [main]>worker0
   4767 ubuntu 20 0 2321164 200188 10200 S 0.3 19.7 0:00.77 Api Webserver
  4717 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 java
  4736 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:08.75 LogStash::Runne
  4737 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 java
  4738 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:02.00 java
  4739 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:08.06 java
  4740 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.03 java
  4741 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.02 java
  4742 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 java
  4743 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 java
  4744 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:26.05 java
  4745 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:05.38 java
  4746 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 java
  4747 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:14.86 java
  4753 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 java
  4754 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:05.30 LogStash::Runne
  4755 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:03.42 LogStash::Runne
  4756 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:03.79 LogStash::Runne
  4757 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:04.64 LogStash::Runne
  4758 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:03.35 [main]-pipeline
  4759 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:01.63 [main]-pipeline
  4761 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.80 [main]-pipeline
  4762 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.04 [main]<beats
  4763 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:13.18 [main]-pipeline
  4764 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:02.78 Api Webserver
  4765 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.92 Api Webserver
  4766 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:01.36 Api Webserver
  4768 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 Api Webserver
  4769 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:01.00 [main]<beats
  4770 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:08.65 LogStash::Runne
  4771 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:08.59 LogStash::Runne
  7694 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:01.21 [main]<beats
  7695 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.05 [main]<beats
  7696 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.00 [main]<beats
  8754 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.63 [main]<beats
  8755 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.03 [main]<beats
  9838 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.03 [main]<beats
  11016 ubuntu 20 0 2321164 200188 10200 S 0.0 19.7 0:00.03 [main]<beats
```

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [June 19, 2017, 2:46am UTC](https://discuss.elastic.co/t/why-does-logstash-consume-cpu-time-in-idle-state/89872/2 "2017-06-19T02:46:00Z")

</div>

This is pretty much much normal and you should expect ~1% CPU usage even when it's "idling". It could be GC, it could logging, it could metrics gathering tasks in the background and it could be all these combined.

---

<div class="post-metadata">

**Author:** ![ka4ok85](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ka4ok85/32/19239_2.png) [@ka4ok85](https://discuss.elastic.co/u/ka4ok85)\
**Post date:** [June 19, 2017, 3:25am UTC](https://discuss.elastic.co/t/why-does-logstash-consume-cpu-time-in-idle-state/89872/3 "2017-06-19T03:25:43Z")

</div>

Thanks for quick response! 1% is not a big deal, just looking for ways how AWS CPU credits can be saved.

---

<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:** [July 17, 2017, 3:25am UTC](https://discuss.elastic.co/t/why-does-logstash-consume-cpu-time-in-idle-state/89872/4 "2017-07-17T03:25:44Z")

</div>

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