# Got many thread waiting in ES TransportClient

**URL:** <https://discuss.elastic.co/t/got-many-thread-waiting-in-es-transportclient/40492>\
**Category:** Elasticsearch\
**Created:** [January 29, 2016, 3:26pm UTC](https://discuss.elastic.co/t/got-many-thread-waiting-in-es-transportclient/40492 "2016-01-29T15:26:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodexy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nodexy/32/1064_2.png) [@nodexy](https://discuss.elastic.co/u/nodexy)\
**Post date:** [January 29, 2016, 3:26pm UTC](https://discuss.elastic.co/t/got-many-thread-waiting-in-es-transportclient/40492/1 "2016-01-29T15:26:57Z")

</div>

I got this issue when invoke es search api in java client . When invoke search api in java by TransportClient **under 500/1000/2000 concurrency press test** , there are many threads waiting

> <https://github.com/elastic/elasticsearch/issues/16287>

Here is the whole stack dump :

> <https://gist.github.com/node/773dc44273d0c78680ed>

and here is my code to search  
`SearchResponse response = esClient .prepareSearch(esManager.getIndexName()) .setTypes(esManager.getIndexType()) .setSearchType(SearchType.DFS_QUERY_THEN_FETCH) .setQuery(mmQuery).setPostFilter(andSearchFilter) .setTrackScores(true) .setMinScore(MyConst.SEARCH_ES_MINSCORE) .addSort(SortBuilders.scoreSort()) .addSort("official", SortOrder.DESC) .addSort("downloadCount", SortOrder.DESC) .setFrom(pageFrom).setSize(pageSize) .setExplain(true).execute().actionGet();`

mmQuery is a MultiMatchQueryBuilder with two fileds , and andSearchFilter is a BoolQueryBuilder .

Any suggestion here ?

---

<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 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/got-many-thread-waiting-in-es-transportclient/40492/2 "2017-07-05T23:20:20Z")

</div>


