# All of the primary shards are on 1 node. Would that bottlenecks our writes?

**URL:** https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418
**Category:** Elasticsearch
**Created:** [June 17, 2020, 8:08am UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418 "2020-06-17T08:08:23Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Jehu\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jehu_t/32/64590_2.png) [@Jehu\_T](https://discuss.elastic.co/u/Jehu_T)
#### Post date: [June 17, 2020, 8:08am UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418/1 "2020-06-17T08:08:23Z")

</div>

Hi,

We see that almost all of the primary shards are on 1 node out of the 3 nodes. Would that bottlenecks our writes? Our ES Indexing Service has code to catch what's basically a "queue full" state on the server and resubmits rejected write requests until they actually go through. By having all primary shards on the one node, I think we do not spread the writes across the 3 nodes, and therefore the queue-able number of requests is 1/3 of what it could be.

Cluster config:

```auto
{
"persistent": {
"cluster": {
"routing": {
"rebalance": {
"enable": "all"
},
"allocation": {
"cluster_concurrent_rebalance": "10",
"node_concurrent_recoveries": "10",
"enable": "all"
}
}
},
"indices": {
"recovery": {
"max_bytes_per_sec": "200mb"
}
},
"xpack": {
"monitoring": {
"collection": {
"enabled": "true"
}
}
}
}

```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 17, 2020, 10:16am UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418/2 "2020-06-17T10:16:15Z")

</div>

Do you have replicas set?

---

<div class="post-metadata">

### Author: ![Jehu\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jehu_t/32/64590_2.png) [@Jehu\_T](https://discuss.elastic.co/u/Jehu_T)
#### Post date: [June 17, 2020, 10:17am UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418/3 "2020-06-17T10:17:12Z")

</div>

Yes 2 replicas. The 2 replicas are on the other 2 nodes. But all the primary shards are on the first node.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 17, 2020, 10:22am UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418/4 "2020-06-17T10:22:24Z")

</div>

Are you sending all the requests to the node with all the primaries?  
How did they all manage to end up on the one node? That's pretty odd, and usually only due to manual intervention.

---

<div class="post-metadata">

### Author: ![Jehu\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jehu_t/32/64590_2.png) [@Jehu\_T](https://discuss.elastic.co/u/Jehu_T)
#### Post date: [June 17, 2020, 11:05am UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418/5 "2020-06-17T11:05:04Z")

</div>

No, we are sending it to all nodes. Any workaround to fix this?

The current status is as below:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/0/7088a66906026549727ef2b7dd28cd20469c5b5d.png)

```auto
{
  "cluster_name" : "cluster",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 464,
  "active_shards" : 1244,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

```

---

<div class="post-metadata">

### Author: ![jcampanell-c2f](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jcampanell-c2f](https://discuss.elastic.co/u/jcampanell-c2f)
#### Post date: [June 23, 2020, 3:17pm UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418/6 "2020-06-23T15:17:31Z")

</div>

Hi,

Let me jump in here. I work with Jehu. We are trying to determine if, when writing to many indexes and many records to these indexes, will we see a degradation in performance if the vast majority of the primary shards are on one node. The code writing to the indexes is written in Java, using the RestHighLevelClient, with all 3 of the nodes' IP addresses/ports provided. In watching the log files, I am occasionally seeing a substantial number of bulk requests returned with something along the lines of a "request queue full" error, which then means the failed records need to be resubmitted until they are processed (there is a small delay before resubmitting the failed requests). My assertion is that by spreading out the primary shards across the cluster, we will get better write performance and fewer failures since there would be a better distribution of the write requests across the cluster. Am I correct in this assumption?

Thanks,  
Jim

---

<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 21, 2020, 3:17pm UTC](https://discuss.elastic.co/t/all-of-the-primary-shards-are-on-1-node-would-that-bottlenecks-our-writes/237418/7 "2020-07-21T15:17:34Z")

</div>

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