# Increase the replica size for the index

**URL:** <https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501>\
**Category:** Elasticsearch\
**Created:** [July 4, 2023, 3:28am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501 "2023-07-04T03:28:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siva\_Karan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siva_karan/32/54688_2.png) [@Siva\_Karan](https://discuss.elastic.co/u/Siva_Karan)\
**Post date:** [July 4, 2023, 3:28am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/1 "2023-07-04T03:28:56Z")

</div>

Hi Team,

we are continously searching the records from the particular index approxmately 25,000 times per hour,so the heap usage is increasing regular period.

we already set the replica value as 1. Now we planned to increase the replica to 2 , to reduce the search load for that particular index.

Is this really helpful to distribute the laod across the data nodes.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 4, 2023, 6:04am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/2 "2023-07-04T06:04:41Z")

</div>

> [@Siva\_Karan](#):
>
> so the heap usage is increasing regular period

Is heap usage a problem or is it increasing and decreasing normally? Do you see any evidence of frequent or long GC in the Elasticsearch logs? Do you have monitoring installed so we can see how heap usage varies over time?

> [@Siva\_Karan](#):
>
> Is this really helpful to distribute the laod across the data nodes.

It can be as there are more shards that can serve requests and spread the load across more nodes.

How many nodes do you have in the cluster? How many primary and replica shards does the index you are referring to have? What is the size and specification of the cluster?

Which version of Elasticsearch are you using?

---

<div class="post-metadata">

**Author:** ![Siva\_Karan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siva_karan/32/54688_2.png) [@Siva\_Karan](https://discuss.elastic.co/u/Siva_Karan)\
**Post date:** [July 4, 2023, 6:34am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/3 "2023-07-04T06:34:32Z")

</div>

we have faced the GC issues in the cluster.  
[o.e.m.j.JvmGcMonitorService] [node1] [gc][144177] overhead, spent [1.7s] collecting in the last [2s]

Master nodes : 3  
Data nodes: 5  
No.of.shard for the index: 5 shards and 1 replica  
heap allocated for the Each node : 10GB  
size of the cluster: 200GB  
Elastic version: 7.3.2

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 4, 2023, 6:38am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/4 "2023-07-04T06:38:08Z")

</div>

> [@Siva\_Karan](#):
>
> Elastic version: 7.3.2

That is a very old version that has been EOL for a long time. I would recommend you upgrade to at least 7.17.

> [@Siva\_Karan](#):
>
> No.of.shard for the index: 5 shards and 1 replica

This means that each node already probably hold 2 shards for that index if it is spread out correctly. If that is the case I do not think adding a replica will help as it likely will increase increase heap usage.

> [@Siva\_Karan](#):
>
> [o.e.m.j.JvmGcMonitorService] [node1] [gc][144177] overhead, spent [1.7s] collecting in the last [2s]

> [@Siva\_Karan](#):
>
> heap allocated for the Each node : 10GB

I seems like you may need to increase the heap size or try to improve heap usage. Are there other indices in the cluster? What is the size of the index you are talking about here?

---

<div class="post-metadata">

**Author:** ![Siva\_Karan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siva_karan/32/54688_2.png) [@Siva\_Karan](https://discuss.elastic.co/u/Siva_Karan)\
**Post date:** [July 4, 2023, 6:43am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/5 "2023-07-04T06:43:05Z")

</div>

for that index it has the primary data of 6.1mb. It has doc count of 9920.

-XX:CMSInitiatingOccupancyFraction=75 for that once it reaches 75% of heap usage, automatically GC occurs.Is this any other possibility to reduce the GC.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 4, 2023, 6:44am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/6 "2023-07-04T06:44:00Z")

</div>

What is the full output of the [cluster stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.8/cluster-stats.html)?

---

<div class="post-metadata">

**Author:** ![Siva\_Karan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siva_karan/32/54688_2.png) [@Siva\_Karan](https://discuss.elastic.co/u/Siva_Karan)\
**Post date:** [July 4, 2023, 7:12am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/7 "2023-07-04T07:12:02Z")

</div>

```auto
{
  "_nodes": {
    "total": 8,
    "successful": 8,
    "failed": 0
  },
  "cluster_name": "cluster",
  "cluster_uuid": "ZN8eyX57QDO56ovr3y8mvA",
  "timestamp": 1688454625658,
  "status": "green",
  "indices": {
    "count": 41,
    "shards": {
      "total": 378,
      "primaries": 189,
      "replication": 1.0,
      "index": {
        "shards": {
          "min": 2,
          "max": 10,
          "avg": 9.21951219512195
        },
        "primaries": {
          "min": 1,
          "max": 5,
          "avg": 4.609756097560975
        },
        "replication": {
          "min": 1.0,
          "max": 1.0,
          "avg": 1.0
        }
      }
    },
    "docs": {
      "count": 68611649,
      "deleted": 1915444
    },
    "store": {
      "size_in_bytes": 449040832933
    },
    "fielddata": {
      "memory_size_in_bytes": 0,
      "evictions": 0
    },
    "query_cache": {
      "memory_size_in_bytes": 727190,
      "total_count": 8033514,
      "hit_count": 3456947,
      "miss_count": 4576567,
      "cache_size": 151,
      "cache_count": 100263,
      "evictions": 100112
    },
    "completion": {
      "size_in_bytes": 0
    },
    "segments": {
      "count": 2324,
      "memory_in_bytes": 209140907,
      "terms_memory_in_bytes": 39222468,
      "stored_fields_memory_in_bytes": 163657096,
      "term_vectors_memory_in_bytes": 0,
      "norms_memory_in_bytes": 46464,
      "points_memory_in_bytes": 4500333,
      "doc_values_memory_in_bytes": 1714546,
      "index_writer_memory_in_bytes": 6503520,
      "version_map_memory_in_bytes": 950,
      "fixed_bit_set_memory_in_bytes": 8358160,
      "max_unsafe_auto_id_timestamp": 1688404041485,
      "file_sizes": {
        
      }
    }
  },
  "nodes": {
    "count": {
      "total": 8,
      "coordinating_only": 0,
      "data": 5,
      "ingest": 0,
      "master": 3,
      "voting_only": 0
    },
    "versions": [
      "7.3.2"
    ],
    "os": {
      "available_processors": 106,
      "allocated_processors": 106,
      "names": [
        {
          "name": "Linux",
          "count": 8
        }
      ],
      "pretty_names": [
        {
          "pretty_name": "Ubuntu 20.04.6 LTS",
          "count": 8
        }
      ],
      "mem": {
        "total_in_bytes": 885082402816,
        "free_in_bytes": 155269054464,
        "used_in_bytes": 729813348352,
        "free_percent": 18,
        "used_percent": 82
      }
    },
    "process": {
      "cpu": {
        "percent": 5
      },
      "open_file_descriptors": {
        "min": 560,
        "max": 7534,
        "avg": 2946
      }
    },
    "jvm": {
      "max_uptime_in_millis": 6555932582,
      "versions": [
        {
          "version": "1.8.0_131",
          "vm_name": "Java HotSpot(TM) 64-Bit Server VM",
          "vm_version": "25.131-b11",
          "vm_vendor": "Oracle Corporation",
          "bundled_jdk": true,
          "using_bundled_jdk": false,
          "count": 8
        }
      ],
      "mem": {
        "heap_used_in_bytes": 25887638752,
        "heap_max_in_bytes": 60699967488
      },
      "threads": 1046
    },
    "fs": {
      "total_in_bytes": 3081931849728,
      "free_in_bytes": 1080494608384,
      "available_in_bytes": 1080393945088
    },
    "plugins": [
      {
        "name": "repository-gcs",
        "version": "7.3.2",
        "elasticsearch_version": "7.3.2",
        "java_version": "1.8",
        "description": "The GCS repository plugin adds Google Cloud Storage support for repositories.",
        "classname": "org.elasticsearch.repositories.gcs.GoogleCloudStoragePlugin",
        "extended_plugins": [
          
        ],
        "has_native_controller": false
      }
    ],
    "network_types": {
      "transport_types": {
        "security4": 8
      },
      "http_types": {
        "security4": 8
      }
    },
    "discovery_types": {
      "zen": 8
    },
    "packaging_types": [
      {
        "flavor": "default",
        "type": "tar",
        "count": 8
      }
    ]
  }
}

```

---

<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:** [August 1, 2023, 7:12am UTC](https://discuss.elastic.co/t/increase-the-replica-size-for-the-index/337501/8 "2023-08-01T07:12:57Z")

</div>

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