# Performance issue at elastic search for actionFuture.actionGet()

**URL:** <https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001>\
**Category:** Elasticsearch\
**Created:** [May 8, 2018, 12:31pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001 "2018-05-08T12:31:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajibsoft](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajibsoft/32/30857_2.png) [@rajibsoft](https://discuss.elastic.co/u/rajibsoft)\
**Post date:** [May 8, 2018, 12:31pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/1 "2018-05-08T12:31:38Z")

</div>

Hi,

Below call is taking time (Avg 550 milliseconds) in my Elasticsearch application which leads to performance issue.

> ListenableActionFuture actionFuture.actionGet().hasFailures()

Has there any way to optimize this call ?

My Elasticsearch version **2.3.2**

Any help is welcome !

Rajib

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 12:59pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/2 "2018-05-08T12:59:12Z")

</div>

How did you built `actionFuture` object?

---

<div class="post-metadata">

**Author:** ![rajibsoft](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajibsoft/32/30857_2.png) [@rajibsoft](https://discuss.elastic.co/u/rajibsoft)\
**Post date:** [May 8, 2018, 1:09pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/3 "2018-05-08T13:09:33Z")

</div>

It is something like below:

> BulkRequestBuilder bulkRequest = esClientManager.getEsClient().prepareBulk();
> 
> UpdateRequestBuilder updateRequestBuilder= esClientManager.getEsClient()  
> .prepareUpdate("ABC", "ABC", 123)  
> .setParent("ABC")  
> .setDoc(valuesByFieldnames)  
> .setDocAsUpsert(true);
> 
> bulkRequest.add(updateRequestBuilder);
> 
> ListenableActionFuture actionFuture = bulkRequest.execute();

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 1:40pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/4 "2018-05-08T13:40:32Z")

</div>

When you say "something" it means that it's not exactly that?

I mean how many elements you have in a single bulk operation?  
Note that Update are slow in general IMO.

---

<div class="post-metadata">

**Author:** ![rajibsoft](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajibsoft/32/30857_2.png) [@rajibsoft](https://discuss.elastic.co/u/rajibsoft)\
**Post date:** [May 8, 2018, 1:57pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/5 "2018-05-08T13:57:03Z")

</div>

It is the actual code. It is an existing implementation on which i am working. And it is one element in the bulk operation.

I am also wonder why they used bulk operation for single element.

Regards,  
Rajib

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 2:37pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/6 "2018-05-08T14:37:48Z")

</div>

Agreed. Does not make sense for a single request IMO.

---

<div class="post-metadata">

**Author:** ![rajibsoft](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajibsoft/32/30857_2.png) [@rajibsoft](https://discuss.elastic.co/u/rajibsoft)\
**Post date:** [May 9, 2018, 12:08pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/7 "2018-05-09T12:08:30Z")

</div>

Hi @dadoonet , I will concentrate at making this single operation but even if bulk operation for single element don't you think it is taking too much time ?

Rajib

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 9, 2018, 12:22pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/8 "2018-05-09T12:22:39Z")

</div>

For a set of pure indexation operation, I'm indexing around 20 documents per second on my laptop (SSD drives). Needless to say that with bulk, I can process 15000 documents per second on the same hardware.

Here it depends on your hardware. The fact that you are doing updates means as well that:

- You send the update query
- Elasticsearch does a GET by ID
- Elasticsearch merges the result with what you sent
- Elasticsearch index the merged document
- Elasticsearch sends you the response

Indexing means basically:

- You send the index query
- Elasticsearch index the document
- Elasticsearch sends you the response

---

<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:** [June 6, 2018, 12:22pm UTC](https://discuss.elastic.co/t/performance-issue-at-elastic-search-for-actionfuture-actionget/131001/9 "2018-06-06T12:22:41Z")

</div>

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