# Tcp time\_wait between logstash agent and elasticsearch cluster nodes

**URL:** <https://discuss.elastic.co/t/tcp-time-wait-between-logstash-agent-and-elasticsearch-cluster-nodes/59936>\
**Category:** Logstash\
**Created:** [September 7, 2016, 2:58am UTC](https://discuss.elastic.co/t/tcp-time-wait-between-logstash-agent-and-elasticsearch-cluster-nodes/59936 "2016-09-07T02:58:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllenBarra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allenbarra/32/84795_2.png) [@AllenBarra](https://discuss.elastic.co/u/AllenBarra)\
**Post date:** [September 7, 2016, 2:58am UTC](https://discuss.elastic.co/t/tcp-time-wait-between-logstash-agent-and-elasticsearch-cluster-nodes/59936/1 "2016-09-07T02:58:15Z")

</div>

My elasticsearch cluster contains two nodes: node\_ip1,node\_ip2.  
When I used logstash-output-elasticsearch to connect elasticsearch cluster, there were lots of tcp time\_wait between logstash and elasticsearch nodes. Here is my logstash configuration:

output {  
elasticsearch {  
hosts =\> ["http://node\_ip1:9200"]  
manage\_template =\> true  
index =\> "logstash-%{+YYY.MM.dd}"  
flush\_size =\> 1500  
idle\_flush\_time =\> 10  
workers =\> 4  
codec =\> "json"  
}  
}

As above, logstash agent had connected to node\_ip1:9200, but there were lots of tcp time\_wait between logstash agent and node\_ip2:9200 (Another elasticsearch node).

How do I resolve this problem?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 7, 2016, 3:06am UTC](https://discuss.elastic.co/t/tcp-time-wait-between-logstash-agent-and-elasticsearch-cluster-nodes/59936/2 "2016-09-07T03:06:27Z")

</div>

Is it causing a problem?

---

<div class="post-metadata">

**Author:** ![AllenBarra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allenbarra/32/84795_2.png) [@AllenBarra](https://discuss.elastic.co/u/AllenBarra)\
**Post date:** [September 7, 2016, 5:38am UTC](https://discuss.elastic.co/t/tcp-time-wait-between-logstash-agent-and-elasticsearch-cluster-nodes/59936/3 "2016-09-07T05:38:00Z")

</div>

In my situation, it really occupies network resources.

---

<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 6, 2017, 4:39am UTC](https://discuss.elastic.co/t/tcp-time-wait-between-logstash-agent-and-elasticsearch-cluster-nodes/59936/4 "2017-07-06T04:39:36Z")

</div>


