# Is elasticsearch client is thread safe?

**URL:** <https://discuss.elastic.co/t/is-elasticsearch-client-is-thread-safe/151745>\
**Category:** Elasticsearch\
**Created:** [October 10, 2018, 4:13am UTC](https://discuss.elastic.co/t/is-elasticsearch-client-is-thread-safe/151745 "2018-10-10T04:13:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohit\_kumar\_Jain](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@rohit\_kumar\_Jain](https://discuss.elastic.co/u/rohit_kumar_Jain)\
**Post date:** [October 10, 2018, 4:13am UTC](https://discuss.elastic.co/t/is-elasticsearch-client-is-thread-safe/151745/1 "2018-10-10T04:13:10Z")

</div>

Hi Geeks,

My question is if elasticsearch client (or es go client) is thread-safe or not?

I mean say suppose I have one es instance is running on 127.0.0.1:9200 and I have multiple indexes and multiple queries to fetch the data from ES. So currently my queries are running in a serial manner but I want my queries to be executed in a parallel manner.

Is it possible to implement using golang ?

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [October 12, 2018, 11:55am UTC](https://discuss.elastic.co/t/is-elasticsearch-client-is-thread-safe/151745/2 "2018-10-12T11:55:49Z")

</div>

I am not sure about go. The java one is definitely thread safe. @tudor can you answer this?

---

<div class="post-metadata">

**Author:** ![rohit\_kumar\_Jain](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@rohit\_kumar\_Jain](https://discuss.elastic.co/u/rohit_kumar_Jain)\
**Post date:** [October 15, 2018, 7:29pm UTC](https://discuss.elastic.co/t/is-elasticsearch-client-is-thread-safe/151745/3 "2018-10-15T19:29:34Z")

</div>

Waiting for some inputs....

I mean say suppose I have one es instance is running on 127.0.0.1:9200 and I have multiple indexes and multiple queries to fetch the data from ES. So currently my queries are running in a serial manner but I want my queries to be executed in a parallel manner, example: I want to create a thread t1, which should run on EC1 (Elastic Search Client 1) which should execute my DSL query Q1. Similarly, another thread t2, should run on EC2 (Elastic Search Client 1) which should execute my DSL query Q2 and so on.

Is it possible to implement using golang ?

If someone can help me asap would be really helpful.

---

<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:** [November 12, 2018, 7:29pm UTC](https://discuss.elastic.co/t/is-elasticsearch-client-is-thread-safe/151745/4 "2018-11-12T19:29:38Z")

</div>

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