# Searches never distribute across nodes in different AWS Availability Zones

**URL:** <https://discuss.elastic.co/t/searches-never-distribute-across-nodes-in-different-aws-availability-zones/371491>\
**Category:** Elasticsearch\
**Created:** [December 4, 2024, 11:00pm UTC](https://discuss.elastic.co/t/searches-never-distribute-across-nodes-in-different-aws-availability-zones/371491 "2024-12-04T23:00:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatertot](https://avatars.discourse-cdn.com/v4/letter/h/e274bd/32.png) [@hatertot](https://discuss.elastic.co/u/hatertot)\
**Post date:** [December 4, 2024, 11:00pm UTC](https://discuss.elastic.co/t/searches-never-distribute-across-nodes-in-different-aws-availability-zones/371491/1 "2024-12-04T23:00:39Z")

</div>

I have a cluster of about 19 nodes on ES 7.17.1. They are all definitely part of the same cluster. Each node has an entire copy of every index. 11 are in us-east-1f, 6 are in us-east-1d, 1 is in 1c and 1 is in 1b. I'd been trying to figure out why requests that routed to 1f were _so much faster_ than those routed to any other zone when I discovered, using profile=true, that every query will only ever use shards in the same availability zone. I've tried and verified countless requests. They do seem to do a good job of distributing load to shards within the same zone.

GET /my\_index/\_search\_shards shows every shard in every availability zone and each one has "state": "STARTED". Cluster status is green. All nodes have 7 search threads and 0 queue (from /\_nodes/stats/thread\_pool).

I've disabled adaptive \_replica\_selection,

```auto
GET /_cluster/settings
--> response:
{
    "persistent": {
        "cluster": {
            "routing": {
                "use_adaptive_replica_selection": "false"
            }
        }
    },
    "transient": {}
}

```

still having the same issue. The only guess I have at this point is that disabling adaptive replica selection has had no effect or might need a rolling restart, which I'm hesitant to perform on our production cluster unless someone thinks I need to in order to disable it.

I was hoping someone might have any helpful insight for me here.  
Thanks much for reading.

---

<div class="post-metadata">

**Author:** ![hatertot](https://avatars.discourse-cdn.com/v4/letter/h/e274bd/32.png) [@hatertot](https://discuss.elastic.co/u/hatertot)\
**Post date:** [December 6, 2024, 11:01pm UTC](https://discuss.elastic.co/t/searches-never-distribute-across-nodes-in-different-aws-availability-zones/371491/2 "2024-12-06T23:01:41Z")

</div>

I found, hidden in a tip in the docs, that even with adaptive replica selection disabled, if a node has shard allocation awareness attributes, then it will prefer shards with the same awareness attribute values.

> **[Search shard routing | Elasticsearch Guide \[7.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/search-shard-routing.html)**

My cluster has a default awareness attribute, "aws\_availability\_zone", I wonder if it was set because I'm using ec2 discovery. Anyway I followed the advice and set the JVM option es.search.ignore\_awareness\_attributes=true, and now my searches beautifully distribute across the entire cluster, which was really freaking important because my use case necessitated large \_msearch'es.

happy problem solving fellow problem solvers
