# Replica shards are not involving while searching

**URL:** <https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688>\
**Category:** Elasticsearch\
**Created:** [October 15, 2019, 3:40pm UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688 "2019-10-15T15:40:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chanakagl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chanakagl/32/54677_2.png) [@chanakagl](https://discuss.elastic.co/u/chanakagl)\
**Post date:** [October 15, 2019, 3:40pm UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/1 "2019-10-15T15:40:52Z")

</div>

Hi,

I have 3 node cluster with time series indices(per day). I have enabled allocation awareness and all nodes in AWS. Node2 is having Index1 all replica shards on it while primaries are assigned to other two nodes. when I running the search queries, Node2(Where replicas in) not involving at all. Is replica shards not using at searching time? please let me know is there any setting needs to be tweaked?

---

<div class="post-metadata">

**Author:** ![chanakagl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chanakagl/32/54677_2.png) [@chanakagl](https://discuss.elastic.co/u/chanakagl)\
**Post date:** [October 16, 2019, 1:04am UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/2 "2019-10-16T01:04:42Z")

</div>

@here could anyone pls help me on this?

---

<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:** [October 16, 2019, 11:22am UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/3 "2019-10-16T11:22:53Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

---

<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:** [October 16, 2019, 11:23am UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/4 "2019-10-16T11:23:42Z")

</div>

Replicas by default are also used to serve search requests. No specific settings required.

---

<div class="post-metadata">

**Author:** ![chanakagl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chanakagl/32/54677_2.png) [@chanakagl](https://discuss.elastic.co/u/chanakagl)\
**Post date:** [October 16, 2019, 2:33pm UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/5 "2019-10-16T14:33:56Z")

</div>

@dadoonet thanks for the reply.

Now I can see replica is serving for the search requests slightly. I'm using 6.2.4 version. I'm having 3 Packetbeat indices and each one has 5 shards and 1 replica and each shard is 5gb of size.  
Below are the CPU stats when executing search quires, I

Node 1 (Primary shard 1,3)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/5/e5501c91a84284eee2423c7f06d053d37dc6daa1.png)

Node2 (All Replicas 0 - 4)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6c1e81235fd44ae406375545be649defab5f13e7.png)

Node3 (Primary shard 0, 2, 4)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/d/8d28038088711195f868582eac1bf50b0c8ebaf7.png)

Is there any setting i can tweak to optimize the searches? I'am using some data histogram aggregation queries to get metrics of the Prod cluster.

---

<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:** [October 18, 2019, 4:03pm UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/6 "2019-10-18T16:03:13Z")

</div>

Few notes:

- You probably need only one shard instead of 5 per index.
- Which node is used by Kibana or your application to hold the search request? I mean that you could may be use a coordinating node if you wish in front of your cluster. May be that will remove some load on one of your data nodes.
- If really needed you can also use the `preference` parameter. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-preference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-preference)

---

<div class="post-metadata">

**Author:** ![chanakagl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chanakagl/32/54677_2.png) [@chanakagl](https://discuss.elastic.co/u/chanakagl)\
**Post date:** [October 19, 2019, 12:48pm UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/7 "2019-10-19T12:48:07Z")

</div>

@dadoonet thank you very much i'll try those also.

---

<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 16, 2019, 12:55pm UTC](https://discuss.elastic.co/t/replica-shards-are-not-involving-while-searching/203688/8 "2019-11-16T12:55:13Z")

</div>

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