# Logstash is periodically hanging (unresponsive). How to recognize and fix?

**URL:** <https://discuss.elastic.co/t/logstash-is-periodically-hanging-unresponsive-how-to-recognize-and-fix/183794>\
**Category:** Logstash\
**Created:** [May 31, 2019, 9:37pm UTC](https://discuss.elastic.co/t/logstash-is-periodically-hanging-unresponsive-how-to-recognize-and-fix/183794 "2019-05-31T21:37:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulDonskikh](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@PaulDonskikh](https://discuss.elastic.co/u/PaulDonskikh)\
**Post date:** [May 31, 2019, 9:37pm UTC](https://discuss.elastic.co/t/logstash-is-periodically-hanging-unresponsive-how-to-recognize-and-fix/183794/1 "2019-05-31T21:37:43Z")

</div>

Hi!  
I'm working on an ELK-stack installation.  
And there's a logstash instance which for some unknown yet reason periodically (once in 2-10 days) stops inserting data into ES.

And the most confusing part is that the logstash does not indicate there's something wrong with it.  
I mean the logstash process does not crash.  
The logs do not show any errors. Even more, it keeps adding some logs as if everything is perfect (jdbc\_static plugin adds logs every hour).

The only way I may know that the logstash stopped inserting data into ES is by looking into kibana and see no new data.

My current thoughts about this issue are:  
I have a lot of devices sending data into logstash (with the lumberjack input plugin). Maybe once in a while my pipeline gets overloaded with the input data (or because of a lot of processing before the output). Logstash is a multi-thread app, so maybe some threads, responsible for either input or output, get blocked.  
But the app itself continues working.

And eventually the only way to "unblock" those threads (and revitalize the logstash) is to re-launch the logstash. And wait another 2-10 days when it stops inserting data.

But this is a baaaaad way of solving the issue.

Has anyone had that kind of issues before?  
How do I make the logstash to unblock its own threads or restart them?  
Or how do I make the logstash to restart itself when its threads are blocked?  
Maybe there's a known way to approach that problem.

Info about my installation:

1. ELK stack version 6.6.0.
2. openjdk version "1.8.0\_201"
3. OS Amazon Linux AMI 2018.03
4. pipeline.workers: 8
5. LS\_JAVA\_OPTS=" -Xmx2g -Xms2g"
6. Logstash is accepting data with the lumberjack input plugin (with congestion\_threshold =\> 15).
7. I have a lot of stuff happening inside the filter section of the config. There's grok, mutate, date, ruby, jdbc\_streaming and jdbc\_static plugins.
8. I also have many devices sending data. Each device can send up to 1000 events per time, every 30 seconds.

Thank you for any help!

---

<div class="post-metadata">

**Author:** ![stcdarrell](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@stcdarrell](https://discuss.elastic.co/u/stcdarrell)\
**Post date:** [June 2, 2019, 1:14pm UTC](https://discuss.elastic.co/t/logstash-is-periodically-hanging-unresponsive-how-to-recognize-and-fix/183794/2 "2019-06-02T13:14:33Z")

</div>

i have had many of the same issues you are reporting.  
Things that could help:  
-If you are using a memory queue, try a persistant queue.

- think about implementing a message queue (redis, rabbit mq, or kafka)  
work flow would be something like:  
logstash --\> Message Queue \<--\> another logstash server (that does processing/enriching)--\> elasticsearch
- install metric beat on your logstash server to monitor usage and workflow

---

<div class="post-metadata">

**Author:** ![PaulDonskikh](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@PaulDonskikh](https://discuss.elastic.co/u/PaulDonskikh)\
**Post date:** [June 3, 2019, 3:09pm UTC](https://discuss.elastic.co/t/logstash-is-periodically-hanging-unresponsive-how-to-recognize-and-fix/183794/3 "2019-06-03T15:09:54Z")

</div>

Darrel, thank you for your response!  
I've been considering using redis. Eventually I might end up using it but at the moment I'm trying to avoid any additional entities in our setup.

So you've had the same issues and after some amount of time spent on finding the solution you decided to use something preventing the logstash to get hanged.  
And I can make an unfortunate conclusion that you have not found the way to solve it on the logstash level. Which would be to unblock the logstash thread (or whatever it is, it's just my assumption) :(.

Following your advice I'm looking at how I can use Metricbeat...

---

<div class="post-metadata">

**Author:** ![PaulDonskikh](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@PaulDonskikh](https://discuss.elastic.co/u/PaulDonskikh)\
**Post date:** [June 14, 2019, 9:56pm UTC](https://discuss.elastic.co/t/logstash-is-periodically-hanging-unresponsive-how-to-recognize-and-fix/183794/4 "2019-06-14T21:56:04Z")

</div>

Found a related topic with no found solutions

> [@Logstash Hangs (thread blocked)](https://discuss.elastic.co/t/logstash-hangs-thread-blocked/137655):
>
> Hi Everyone, We're running a Logstash pipeline with TCP input \> JSON filter \> ES output, and most of the time it goes great, except sometimes logstash will stop inserting data into ES without any log that we could find, and without crashing. It just hangs and stops processing data. The frequency of such 'freezes' is variable, roughly every one or two days. We send data to the TCP input (with SSL) from about 10 devices, at around 3 logs/second. The monitoring API shows that a worker thread som…

---

<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 12, 2019, 9:56pm UTC](https://discuss.elastic.co/t/logstash-is-periodically-hanging-unresponsive-how-to-recognize-and-fix/183794/5 "2019-07-12T21:56:07Z")

</div>

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