# Manage the connection pool size in Java client

**URL:** <https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 9, 2024, 6:17am UTC](https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762 "2024-07-09T06:17:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyansh\_Maheshwari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyansh_maheshwari/32/135010_2.png) [@Priyansh\_Maheshwari](https://discuss.elastic.co/u/Priyansh_Maheshwari)\
**Post date:** [July 9, 2024, 6:17am UTC](https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762/1 "2024-07-09T06:17:01Z")

</div>

Hi,

I am currently utilizing the ElasticsearchClient library in java for connecting to Elasticsearch. As per the docs the library manages its own connection pool and its not required to create a separate client with each thread. However, I wanted to manage the connection pool size like the max/min number of connections that the client creates or so. Was unable to find any doc specific to this.

Apologies if I missed something obvious here.

Thanks.

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [July 9, 2024, 9:21am UTC](https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762/2 "2024-07-09T09:21:35Z")

</div>

From #Elastic Search to #Elasticsearch

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [July 9, 2024, 9:21am UTC](https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762/3 "2024-07-09T09:21:35Z")

</div>

Added #language-clients

---

<div class="post-metadata">

**Author:** ![Priyansh\_Maheshwari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyansh_maheshwari/32/135010_2.png) [@Priyansh\_Maheshwari](https://discuss.elastic.co/u/Priyansh_Maheshwari)\
**Post date:** [July 11, 2024, 5:57am UTC](https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762/4 "2024-07-11T05:57:23Z")

</div>

Hi, any insights on this? I'm still struggling with the issue for its necessary to have an idea of the connection pool. Thanks!

---

<div class="post-metadata">

**Author:** ![ltrotta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ltrotta/32/124003_2.png) [@ltrotta](https://discuss.elastic.co/u/ltrotta)\
**Post date:** [July 12, 2024, 4:04pm UTC](https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762/5 "2024-07-12T16:04:42Z")

</div>

Hello!  
The connection is managed by the low level rest client, [here](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/8.14/java-rest-low.html) is where you can find its documentation; for example [here](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/8.14/_number_of_threads.html) it's explained how to configure threads.  
Hope it helps!

---

<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:** [August 9, 2024, 4:05pm UTC](https://discuss.elastic.co/t/manage-the-connection-pool-size-in-java-client/362762/6 "2024-08-09T16:05:29Z")

</div>

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