# Delete by query fails often with HTTP 503

**URL:** <https://discuss.elastic.co/t/delete-by-query-fails-often-with-http-503/16415>\
**Category:** Elasticsearch\
**Created:** [March 18, 2014, 7:13am UTC](https://discuss.elastic.co/t/delete-by-query-fails-often-with-http-503/16415 "2014-03-18T07:13:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_S](https://avatars.discourse-cdn.com/v4/letter/t/a698b9/32.png) [@Thomas\_S](https://discuss.elastic.co/u/Thomas_S)\
**Post date:** [March 18, 2014, 7:13am UTC](https://discuss.elastic.co/t/delete-by-query-fails-often-with-http-503/16415/1 "2014-03-18T07:13:20Z")

</div>

Hi,

We often get failures when using the delete by query API. The response is  
an HTTP 503 with a body like this:

{"\_indices": {"myindex": {"\_shards": {"successful": 2, "failed": 58,  
"total": 60}}}}

Is there a way to figure out what is causing this error? It seems to mostly  
happen when the search cluster is busy.

Thomas

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 18, 2014, 5:11pm UTC](https://discuss.elastic.co/t/delete-by-query-fails-often-with-http-503/16415/2 "2014-03-18T17:11:27Z")

</div>

Do you have lots of shards on just a few nodes? Delete by query is handled  
by the `index` thread pool, but those threads are shared across all shards  
on a node. Delete by query can produce a large number of changes, which  
can fill up the thread pool queue and result in rejections.

You can either just (a) retry or (b) increase the queue size for the  
`index` thread pool (which will use more memory as more delete requests  
will need to be queued)

See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

On 18 March 2014 08:13, Thomas S. [thomas.st@gmail.com](mailto:thomas.st@gmail.com) wrote:

> Hi,
> 
> We often get failures when using the delete by query API. The response is  
> an HTTP 503 with a body like this:
> 
> {"\_indices": {"myindex": {"\_shards": {"successful": 2, "failed": 58,  
> "total": 60}}}}
> 
> Is there a way to figure out what is causing this error? It seems to  
> mostly happen when the search cluster is busy.
> 
> Thomas
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPt3XKTOAAc0ov6YrKGj1Fgkxkh%2BA5%2Bya1LKSfXjX5gVtbb9xA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPt3XKTOAAc0ov6YrKGj1Fgkxkh%2BA5%2Bya1LKSfXjX5gVtbb9xA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Thomas\_S](https://avatars.discourse-cdn.com/v4/letter/t/a698b9/32.png) [@Thomas\_S](https://discuss.elastic.co/u/Thomas_S)\
**Post date:** [March 18, 2014, 8:19pm UTC](https://discuss.elastic.co/t/delete-by-query-fails-often-with-http-503/16415/3 "2014-03-18T20:19:47Z")

</div>

Thanks Clint,

We have two nodes with 60 shards per node. I will increase the queue size.  
Hopefully this will reduce the amount of rejections.

Thomas

On Tuesday, March 18, 2014 6:11:27 PM UTC+1, Clinton Gormley wrote:

> Do you have lots of shards on just a few nodes? Delete by query is handled  
> by the `index` thread pool, but those threads are shared across all shards  
> on a node. Delete by query can produce a large number of changes, which  
> can fill up the thread pool queue and result in rejections.
> 
> You can either just (a) retry or (b) increase the queue size for the  
> `index` thread pool (which will use more memory as more delete requests  
> will need to be queued)
> 
> See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-threadpool.html#types)
> 
> clint
> 
> On 18 March 2014 08:13, Thomas S. \<[thom...@gmail.com](mailto:thom...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi,
> > 
> > We often get failures when using the delete by query API. The response is  
> > an HTTP 503 with a body like this:
> > 
> > {"\_indices": {"myindex": {"\_shards": {"successful": 2, "failed": 58,  
> > "total": 60}}}}
> > 
> > Is there a way to figure out what is causing this error? It seems to  
> > mostly happen when the search cluster is busy.
> > 
> > Thomas
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f8c84eaf-79b9-4f4e-9b26-732d11544fb9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b815184a-8382-4b25-8a54-b98753f6cbb4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b815184a-8382-4b25-8a54-b98753f6cbb4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:42am UTC](https://discuss.elastic.co/t/delete-by-query-fails-often-with-http-503/16415/4 "2017-07-06T01:42:24Z")

</div>


