# How many logstash can connect to elasticsearch cluster?

**URL:** <https://discuss.elastic.co/t/how-many-logstash-can-connect-to-elasticsearch-cluster/290242>\
**Category:** Elasticsearch\
**Created:** [November 26, 2021, 7:14am UTC](https://discuss.elastic.co/t/how-many-logstash-can-connect-to-elasticsearch-cluster/290242 "2021-11-26T07:14:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kannan\_raj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kannan_raj/32/63201_2.png) [@kannan\_raj](https://discuss.elastic.co/u/kannan_raj)\
**Post date:** [November 26, 2021, 7:14am UTC](https://discuss.elastic.co/t/how-many-logstash-can-connect-to-elasticsearch-cluster/290242/1 "2021-11-26T07:14:28Z")

</div>

we have logstash with 4 pipeline and each pipeline.worker is set to 120 and Elasticsearch cluster has 6 data nodes.(c5.9xlarge)

we are facing high cpu usage in Elasticsearch data nodes when we have more than 10 logstash.

what is the max workers or logstash can we have?

---

<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:** [November 26, 2021, 7:43am UTC](https://discuss.elastic.co/t/how-many-logstash-can-connect-to-elasticsearch-cluster/290242/2 "2021-11-26T07:43:01Z")

</div>

Why would you have 120 workers configured per pipeline? That sounds excessive and I would recommend reducing that significantly so the total number of workers roughly matches the number of CPU cores on the host where it runs. Larger number does not necessarily equal better performance.

If you want to improve performance instead look at increasing the batch size a bit but do not go crazy.

There is no hard limit with respect to how many connections a node can handle as it depends on the load and how many indices and shards each bulk requests targets. You will need to test.

---

<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:** [December 24, 2021, 7:43am UTC](https://discuss.elastic.co/t/how-many-logstash-can-connect-to-elasticsearch-cluster/290242/3 "2021-12-24T07:43:44Z")

</div>

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