# Congestion issues in Redis coming from Logstash

**URL:** <https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921>\
**Category:** Logstash\
**Created:** [February 11, 2019, 7:52pm UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921 "2019-02-11T19:52:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![drivera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drivera/32/39900_2.png) [@drivera](https://discuss.elastic.co/u/drivera)\
**Post date:** [February 11, 2019, 7:52pm UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/1 "2019-02-11T19:52:09Z")

</div>

Hello, I am running LS 5.3 with 5 nodes load balanced and ES 5.3, using Redis to throttle events. I am receiving the error message below within Redis, I believe this is coming from Logstash but I'm not sure how to resolve.

[2019-02-11T11:49:29,923][WARN][logstash.outputs.redis] Redis key size has hit a congestion threshold 2200000 suspending output for 1 seconds

**Here is my input LS config file in redis:**

```auto
input {
  beats {
    port => "5043"
    tags => ["aemlogs","fglam"]
    type => "linux-logs"
  }
}
output {
  if ("aemlogs" in [tags]) {
    redis {
      data_type => "list"
      key => "linux-beats"
      congestion_threshold => "2200000"
    }
  }

  if ("fglam" in [tags]) {
    redis {
      data_type => "list"
      key => "linux-beats"
      congestion_threshold => "2200000"
    }
  }
}

```

**This is my logstash collector config file:**

```auto
input {
  redis {
    type => "linux-logs"
    data_type => "list"
    key => "linux-beats"
    port => "6379"
    host => "redis-host"
  }
}
filter {
    if ("aemlogs" in [tags]) {
        grok {
          timeout_millis => 5000
          tag_on_failure => ["_grokparsefailure","_fglamparsefailure"]
          match => { "message" => "^%{TIMESTAMP_ISO8601:timestamp}%{SPACE}((%{SEV:log-level}%{SPACE}\[%{DATASET1:dataset1}\])?)((%{WORD}%{SPACE}\<(%{UUID:uuid}\/)?%{WORD:namespace}\/%{VERSION:version}\/%{WORD:agent_type}\/%{AGENT:agent}\>)?)%{SPACE}%{SEV:log-level}%{SPACE}\[%{DATASET1:dataset1}\]%{SPACE}%{DATASET2:dataset2}(\s-\s)%{GREEDYDATA:message}" }
          overwrite => ["message"]
        }
        date {
            match => ["timestamp", "YYYY-MM-dd HH:mm:ss.SSS","ISO8601"]
            target => "@timestamp"
            remove_field => ["timestamp"]
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [February 12, 2019, 7:08am UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/2 "2019-02-12T07:08:55Z")

</div>

The message is coming from the Redis Output Plugin and indicates the the key in redis that it is configured to send data to has more than the configured number of items in it (e.g., whatever is supposed to consume from this `list` is slower than the things that are producing to that key).

From the docs:

> In case Redis `data_type` is `list` and has more than `congestion_threshold` items, block until someone consumes them and reduces congestion, otherwise if there are no consumers Redis will run out of memory, unless it was configured with OOM protection. But even with OOM protection, a single Redis list can block all other users of Redis, until Redis CPU consumption reaches the max allowed RAM size. A default value of 0 means that this limit is disabled. Only supported for `list` Redis `data_type` .
> 
> -- [Logstash: Redis Output Plugin - `congestion_threshold`](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-redis.html#plugins-outputs-redis-congestion_threshold)

---

<div class="post-metadata">

**Author:** ![drivera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drivera/32/39900_2.png) [@drivera](https://discuss.elastic.co/u/drivera)\
**Post date:** [February 12, 2019, 5:14pm UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/3 "2019-02-12T17:14:31Z")

</div>

Thanks for the reply Ry, so does this mean that I can temporarily set the threshold to; congestion\_treshold =\> “0” in order to avoid throttling the events?

Also, where did you find the docs for Redis errors?

**Dion Rivera**

Esri Information Systems and Technology |  
[drivera@esri.com](mailto:drivera@esri.com) | 909-793-2853 x1860

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [February 12, 2019, 6:55pm UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/4 "2019-02-12T18:55:43Z")

</div>

The congestion threshold is a safeguard to prevent you from losing data, as is likely to occur when Redis runs out of memory. While it is possible to remove the safeguard, the correct solution is to ensure that whatever is supposed to be consuming from that list has the resources it needs to consume as fast as you are producing.

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [February 12, 2019, 6:59pm UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/5 "2019-02-12T18:59:26Z")

</div>

> [@drivera](#):
>
> where did you find the docs for Redis errors?

I am not sure what you are asking here. I linked to the relevant documentation, which I found by plugging "Logstash Redis Output" into my search engine.

---

<div class="post-metadata">

**Author:** ![drivera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drivera/32/39900_2.png) [@drivera](https://discuss.elastic.co/u/drivera)\
**Post date:** [February 13, 2019, 12:25am UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/6 "2019-02-13T00:25:00Z")

</div>

Thanks for the help Ry.

**Dion Rivera**

Esri Information Systems and Technology |  
[drivera@esri.com](mailto:drivera@esri.com) | 909-793-2853 x1860

---

<div class="post-metadata">

**Author:** ![drivera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drivera/32/39900_2.png) [@drivera](https://discuss.elastic.co/u/drivera)\
**Post date:** [February 23, 2019, 12:35am UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/7 "2019-02-23T00:35:14Z")

</div>

Update on this issue: As @yaauie stated above, there was nothing on the LS side consuming events coming from the Redis key which caused them to pile up and throw the "Congestion" error. The LS config pipeline that was supposed to consume events coming from the Redis key was accidentally deleted. Once recovered, problem went away.

---

<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:** [March 23, 2019, 12:46am UTC](https://discuss.elastic.co/t/congestion-issues-in-redis-coming-from-logstash/167921/8 "2019-03-23T00:46:43Z")

</div>

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