# Looking for recommended timeouts for ES client

**URL:** <https://discuss.elastic.co/t/looking-for-recommended-timeouts-for-es-client/149843>\
**Category:** Elasticsearch\
**Created:** [September 25, 2018, 1:56pm UTC](https://discuss.elastic.co/t/looking-for-recommended-timeouts-for-es-client/149843 "2018-09-25T13:56:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronsher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ronsher/32/1334_2.png) [@ronsher](https://discuss.elastic.co/u/ronsher)\
**Post date:** [September 25, 2018, 1:56pm UTC](https://discuss.elastic.co/t/looking-for-recommended-timeouts-for-es-client/149843/1 "2018-09-25T13:56:54Z")

</div>

Hi,

We're using ES 5.3. I'm looking for recommended timeout settings that will allow to quickly figure out if any of the client nodes isn't operational but will allow for very slow queries. I find it hard to distinguish between the various timeout settings so any elaboration on them would be helpful.

This is what we currently use:  
private final int CONNECTION\_TIMEOUT\_MILLIS = 5\_000;  
private final int SOCKET\_TIMEOUT\_MILLIS = 600\_000;  
private final int MAX\_RETRY\_TIMEOUT\_MILLIS = 600\_000;

client = RestClient.builder(hosts).setMaxRetryTimeoutMillis(MAX\_RETRY\_TIMEOUT\_MILLIS)  
.setRequestConfigCallback(requestConfigBuilder -\> requestConfigBuilder  
.setConnectTimeout(CONNECTION\_TIMEOUT\_MILLIS).setSocketTimeout(SOCKET\_TIMEOUT\_MILLIS))  
.build();  
}

This isn't good as the timeout we have is too long for figuring out the client isn't accessible. I thought the client should figure out in 5 seconds that it has issues connecting to the client node, but it took 10 minutes.

Thanks for your help

---

<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:** [October 23, 2018, 1:56pm UTC](https://discuss.elastic.co/t/looking-for-recommended-timeouts-for-es-client/149843/2 "2018-10-23T13:56:59Z")

</div>

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