# Should i create restClient thread pool in rest api?

**URL:** <https://discuss.elastic.co/t/should-i-create-restclient-thread-pool-in-rest-api/74589>\
**Category:** Elasticsearch\
**Created:** [February 10, 2017, 2:59am UTC](https://discuss.elastic.co/t/should-i-create-restclient-thread-pool-in-rest-api/74589 "2017-02-10T02:59:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![2010](https://avatars.discourse-cdn.com/v4/letter/2/71c47a/32.png) [@2010](https://discuss.elastic.co/u/2010)\
**Post date:** [February 10, 2017, 2:59am UTC](https://discuss.elastic.co/t/should-i-create-restclient-thread-pool-in-rest-api/74589/1 "2017-02-10T02:59:10Z")

</div>

Now, i creating a restClient to requesting es-server , it is low-peformance?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 10, 2017, 4:13pm UTC](https://discuss.elastic.co/t/should-i-create-restclient-thread-pool-in-rest-api/74589/2 "2017-02-10T16:13:04Z")

</div>

The low level Elasticsearch rest client spins up a couple of background threads to support async-httpclient so you should only use one copy of it. You can customize the thread pool by specifying callbacks in the builder.

---

<div class="post-metadata">

**Author:** ![2010](https://avatars.discourse-cdn.com/v4/letter/2/71c47a/32.png) [@2010](https://discuss.elastic.co/u/2010)\
**Post date:** [February 24, 2017, 3:23am UTC](https://discuss.elastic.co/t/should-i-create-restclient-thread-pool-in-rest-api/74589/3 "2017-02-24T03:23:37Z")

</div>

Tank you

---

<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:** [March 24, 2017, 3:23am UTC](https://discuss.elastic.co/t/should-i-create-restclient-thread-pool-in-rest-api/74589/4 "2017-03-24T03:23:59Z")

</div>

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