# Routing or Queuing happens first?

**URL:** https://discuss.elastic.co/t/routing-or-queuing-happens-first/61765
**Category:** Elasticsearch
**Created:** [September 29, 2016, 5:31am UTC](https://discuss.elastic.co/t/routing-or-queuing-happens-first/61765 "2016-09-29T05:31:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [September 29, 2016, 5:31am UTC](https://discuss.elastic.co/t/routing-or-queuing-happens-first/61765/1 "2016-09-29T05:31:31Z")

</div>

Lets assume , we are sending bulk request to a node and lets assume that node is not where the documents in the bulk is supposed to go , based on shard the document is mapped to.

Here what will happen first , queuing to the thread pool queue or redirecting the request ?

Also when the bulk is processed , is it again sent to the index queue or is it directly processed ?

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [September 29, 2016, 9:09am UTC](https://discuss.elastic.co/t/routing-or-queuing-happens-first/61765/2 "2016-09-29T09:09:20Z")

</div>

Routing happens first. Queuing happens on the node where the document is supposed to get indexed.

---

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [September 29, 2016, 6:11pm UTC](https://discuss.elastic.co/t/routing-or-queuing-happens-first/61765/3 "2016-09-29T18:11:34Z")

</div>

Hello Adrien ,

So if i get it right , when a bulk request happens , its is divided into individual index requests and forwarded to the right nodes without pushing the data to queue right.  
If this is so , i was wondering if there are huge number of bulk requests wont the machine go out of resource just processing this itself ?

Thanks  
Vineeth

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [October 3, 2016, 9:25pm UTC](https://discuss.elastic.co/t/routing-or-queuing-happens-first/61765/4 "2016-10-03T21:25:03Z")

</div>

I guess it could, but you'd need these bulk requests to be insanely large in order to trigger this issue, and most of them would be rejected at the shard level.

---

<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, 10:15pm UTC](https://discuss.elastic.co/t/routing-or-queuing-happens-first/61765/5 "2017-07-05T22:15:18Z")

</div>


