# Mapping routing keys to shards

**URL:** <https://discuss.elastic.co/t/mapping-routing-keys-to-shards/7843>\
**Category:** Elasticsearch\
**Created:** [May 24, 2012, 3:02pm UTC](https://discuss.elastic.co/t/mapping-routing-keys-to-shards/7843 "2012-05-24T15:02:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_J](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@Tim\_J](https://discuss.elastic.co/u/Tim_J)\
**Post date:** [May 24, 2012, 3:02pm UTC](https://discuss.elastic.co/t/mapping-routing-keys-to-shards/7843/1 "2012-05-24T15:02:59Z")

</div>

Is there an easy way to tell which routing keys map to which shards?  
I understand the algorithm is something like hash(routing\_key) %  
shard\_count but I was hoping for a "trace" API of sorts to figure out  
where my requests are actually ending up. Trying to nail down some  
performance issues.

Thanks,  
-Tim

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 29, 2012, 6:10pm UTC](https://discuss.elastic.co/t/mapping-routing-keys-to-shards/7843/2 "2012-05-29T18:10:50Z")

</div>

First, the stats APIs (node and index level) can give you doc counts and  
sizes per shard, this might help. You could turn index.engine debug level  
to TRACE and see actual index operations (though its not recommended to  
keep it on).

On Thu, May 24, 2012 at 5:02 PM, Tim J [jones.timothy.r@gmail.com](mailto:jones.timothy.r@gmail.com) wrote:

> Is there an easy way to tell which routing keys map to which shards?  
> I understand the algorithm is something like hash(routing\_key) %  
> shard\_count but I was hoping for a "trace" API of sorts to figure out  
> where my requests are actually ending up. Trying to nail down some  
> performance issues.
> 
> Thanks,  
> -Tim

---

<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, 3:26am UTC](https://discuss.elastic.co/t/mapping-routing-keys-to-shards/7843/3 "2017-07-06T03:26:37Z")

</div>

Closed on July 6, 2017, 3:26am UTC


