# Elasticsearch Memory Consumption

**URL:** <https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336>\
**Category:** Elasticsearch\
**Created:** [February 7, 2020, 11:47am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336 "2020-02-07T11:47:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![guruprasadb](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@guruprasadb](https://discuss.elastic.co/u/guruprasadb)\
**Post date:** [February 7, 2020, 11:47am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/1 "2020-02-07T11:47:52Z")

</div>

Hello,

In the current system we have 90 days of logs. However, most of the time, only 30 days of data is queried. So, I am thinking of following optimizations to manage old indices to reduce system memory utilization.

Option 1)

1. Moving all primary shards to one node
2. Shrink the data
3. Forcemerge the data to a single segment (max documents is 120 million and single segment size is about 35 GB)

Will this help save heap memory significantly? How will this impact the query performance?

My current heap and ram usage is very high. Shown Below . Here ram.percent is quite high. However, sufficient RAM is free, about 20 GB of 64 GB. Why is this ram.percent very high?

curl -X GET "http://IP:PORT/\_cat/nodes?v"  
ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
HOST1 86 98 4 1.25 1.23 1.25 mdi - node-3  
HOST2 93 97 6 1.52 1.44 1.45 mdi - node-1  
HOST3 92 98 4 0.88 1.26 1.31 mdi \* node-2  
HOST4 95 98 6 1.39 1.74 1.67 mdi - node-4

Option 2)

Close the old indices(older than 30 days). I can provide a mechanism to Open the indices when any closed index is queried and close the same after the query execution. Will this help save the system memory resources.

Which of the above options will help optimize the system resource memory usage and what is the recommended approach?

Index Stats for one of the node is given below :  
{  
"\_nodes" : {  
"total" : 4,  
"successful" : 4,  
"failed" : 0  
},  
"cluster\_name" : "xxx-cluster",  
"nodes" : {  
"RQ50cjGaTJyDflmJqQKj5w" : {  
"timestamp" : 1581074219257,  
"name" : "node-3",  
"transport\_address" : "",  
"host" : "",  
"ip" : "",  
"roles" : [  
"master",  
"data",  
"ingest"  
],  
"attributes" : {  
"ml.machine\_memory" : "67378851840",  
"ml.max\_open\_jobs" : "20",  
"xpack.installed" : "true",  
"ml.enabled" : "true"  
},  
"indices" : {  
"docs" : {  
"count" : 5088498671,  
"deleted" : 0  
},  
"store" : {  
"size\_in\_bytes" : 1647950022235  
},  
"indexing" : {  
"index\_total" : 44423906,  
"index\_time\_in\_millis" : 18482112,  
"index\_current" : 0,  
"index\_failed" : 0,  
"delete\_total" : 0,  
"delete\_time\_in\_millis" : 0,  
"delete\_current" : 0,  
"noop\_update\_total" : 0,  
"is\_throttled" : false,  
"throttle\_time\_in\_millis" : 0  
},  
"get" : {  
"total" : 0,  
"time\_in\_millis" : 0,  
"exists\_total" : 0,  
"exists\_time\_in\_millis" : 0,  
"missing\_total" : 0,  
"missing\_time\_in\_millis" : 0,  
"current" : 0  
},  
"search" : {  
"open\_contexts" : 10,  
"query\_total" : 14334,  
"query\_time\_in\_millis" : 530529,  
"query\_current" : 10,  
"fetch\_total" : 2864,  
"fetch\_time\_in\_millis" : 4748083,  
"fetch\_current" : 0,  
"scroll\_total" : 10,  
"scroll\_time\_in\_millis" : 47487324,  
"scroll\_current" : 0,  
"suggest\_total" : 0,  
"suggest\_time\_in\_millis" : 0,  
"suggest\_current" : 0  
},  
"merges" : {  
"current" : 0,  
"current\_docs" : 0,  
"current\_size\_in\_bytes" : 0,  
"total" : 4507,  
"total\_time\_in\_millis" : 12197240,  
"total\_docs" : 171012154,  
"total\_size\_in\_bytes" : 56604653805,  
"total\_stopped\_time\_in\_millis" : 0,  
"total\_throttled\_time\_in\_millis" : 5493618,  
"total\_auto\_throttle\_in\_bytes" : 17097031680  
},  
"refresh" : {  
"total" : 15005,  
"total\_time\_in\_millis" : 3205850,  
"listeners" : 0  
},  
"flush" : {  
"total" : 539,  
"periodic" : 76,  
"total\_time\_in\_millis" : 305456  
},  
"warmer" : {  
"current" : 0,  
"total" : 13505,  
"total\_time\_in\_millis" : 8185595  
},  
"query\_cache" : {  
"memory\_size\_in\_bytes" : 38048113,  
"total\_count" : 76546,  
"hit\_count" : 72281,  
"miss\_count" : 4265,  
"cache\_size" : 106,  
"cache\_count" : 132,  
"evictions" : 26  
},  
"fielddata" : {  
"memory\_size\_in\_bytes" : 15439073464,  
"evictions" : 0  
},  
"completion" : {  
"size\_in\_bytes" : 0  
},  
"segments" : {  
"count" : 10578,  
"memory\_in\_bytes" : 5687338579,  
"terms\_memory\_in\_bytes" : 5384658391,  
"stored\_fields\_memory\_in\_bytes" : 239039736,  
"term\_vectors\_memory\_in\_bytes" : 0,  
"norms\_memory\_in\_bytes" : 1299520,  
"points\_memory\_in\_bytes" : 59617508,  
"doc\_values\_memory\_in\_bytes" : 2723424,  
"index\_writer\_memory\_in\_bytes" : 30111104,  
"version\_map\_memory\_in\_bytes" : 0,  
"fixed\_bit\_set\_memory\_in\_bytes" : 636700504,  
"max\_unsafe\_auto\_id\_timestamp" : 1581019261329,  
"file\_sizes" : { }  
},  
"translog" : {  
"operations" : 2230958,  
"size\_in\_bytes" : 1385529357,  
"uncommitted\_operations" : 1316853,  
"uncommitted\_size\_in\_bytes" : 579925452,  
"earliest\_last\_modified\_age" : 0  
},  
"request\_cache" : {  
"memory\_size\_in\_bytes" : 104000,  
"evictions" : 0,  
"hit\_count" : 3,  
"miss\_count" : 25  
},  
"recovery" : {  
"current\_as\_source" : 0,  
"current\_as\_target" : 0,  
"throttle\_time\_in\_millis" : 2252275  
}  
}  
},

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [February 7, 2020, 12:05pm UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/2 "2020-02-07T12:05:10Z")

</div>

Hi @guruprasadb

First off, I think [Frozen Indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/frozen-indices.html) may be what you are looking for if you can live with slow queries on old data (opening an index just for querying would certainly be slower in most cases still so I'm assuming this option would work for you).

> [@guruprasadb](#):
>
> Will this help save heap memory significantly? How will this impact the query performance?

I don't think you'll be able to move all primaries to one node if you also have replicas. There is no way of doing that (and it's not really a useful thing to do, what if that node goes down ... then replicas will take over and your primaries are all over the place again).

> [@guruprasadb](#):
>
> Will this help save heap memory significantly? How will this impact the query performance?

> 1. Forcemerge the data to a single segment (max documents is 120 million and single segment size is about 35 GB)

If the data isn't going to change any more this will save some memory and improve performance most likely I would assume. The exact degree to which this happens is hard to predict and something to try out I think.

> [@guruprasadb](#):
>
> Here ram.percent is quite high. However, sufficient RAM is free, about 20 GB of 64 GB. Why is this ram.percent very high?

Afaik ram.percentage includes page cache use as well, that's probably why the number is so high overall as well.

=\> you could try force merging things that will never change again and see if that's enough.  
=\> Option 2) doesn't seem reasonable to me, when frozen indices are available. Opening an index is costly resource wise and not something that should be part of a one time query.

---

<div class="post-metadata">

**Author:** ![guruprasadb](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@guruprasadb](https://discuss.elastic.co/u/guruprasadb)\
**Post date:** [February 10, 2020, 10:31am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/3 "2020-02-10T10:31:07Z")

</div>

> [@Armin\_Braun](#):
>
> doesn't seem reasonable to me, when frozen indices are available. Opening an index is costly resource wise and not something that should be part of a one time query.

Dear Armin,

Thanks for your inputs. How can i improve the memory utilization given the below data. I am looking at optimizations other than freezing the old unused indices?

I keep running into frequent GC taking more than 30 seconds and any executing aggregation queries on many days of data times out and fails.

I have four nodes with 24 cores and 64GB RAM and 32G of JVM HEAP. Daily index and each index has about 100 million records. 90 days of data is retained in the system. Best Compression is used with 5 Shards and 1 replica.

Heap Utilization Percentage is more than 85%  
Fielddata Memory is about 15 GB (per node)  
Segment Memory is about 5.3 GB (per node)  
Translog Size in Byttes is about 1.4 GB (per node)  
Size of Compressed data consumed by all shards : 6511 GB (total size handled by 4 nodes. Sum of all values from output of "\_cat/shards?")  
"active\_primary\_shards" : 1645 (all nodes)

# ================================================================ Logs and output of different commands is given below

* * *

## Output of : \_nodes/stats/indices

"query\_cache" : {  
"memory\_size\_in\_bytes" : 250483404,  
"total\_count" : 345506,  
"hit\_count" : 265900,  
"miss\_count" : 79606,  
"cache\_size" : 885,  
"cache\_count" : 2055,  
"evictions" : 1170  
},  
"fielddata" : {  
"memory\_size\_in\_bytes" : 15607420544,  
"evictions" : 0  
},  
"completion" : {  
"size\_in\_bytes" : 0  
},  
"segments" : {  
"count" : 10786,  
"memory\_in\_bytes" : 5743504096,  
"terms\_memory\_in\_bytes" : 5435352021,  
"stored\_fields\_memory\_in\_bytes" : 242611112,  
"term\_vectors\_memory\_in\_bytes" : 0,  
"norms\_memory\_in\_bytes" : 1295936,  
"points\_memory\_in\_bytes" : 61446083,  
"doc\_values\_memory\_in\_bytes" : 2798944,  
"index\_writer\_memory\_in\_bytes" : 17527760,  
"version\_map\_memory\_in\_bytes" : 0,  
"fixed\_bit\_set\_memory\_in\_bytes" : 648466280,  
"max\_unsafe\_auto\_id\_timestamp" : 1581278460804,  
"file\_sizes" : { }  
},  
"translog" : {  
"operations" : 2831157,  
"size\_in\_bytes" : 1549152668,  
"uncommitted\_operations" : 1788929,  
"uncommitted\_size\_in\_bytes" : 609003907,  
"earliest\_last\_modified\_age" : 0  
},  
"request\_cache" : {  
"memory\_size\_in\_bytes" : 44842106,  
"evictions" : 0,  
"hit\_count" : 309,  
"miss\_count" : 8221  
},

* * *

## Output of : \_cat/nodes?v

ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
x.x.x.x 93 95 8 1.35 1.95 1.93 mdi - node-3  
x.x.x.x 87 94 10 1.67 1.90 2.24 mdi - node-1  
x.x.x.x 89 97 6 0.43 1.00 1.32 mdi \* node-2  
x.x.x.x 88 94 5 0.69 0.92 1.12 mdi - node-4

* * *

## Output of : \_cluster/stats?

"cluster\_name" : "my-cluster",  
"cluster\_uuid" : "ntFmtDanQx2yTaivjvSPBw",  
"timestamp" : 1581324608473,  
"status" : "green",  
"indices" : {  
"count" : 329,  
"shards" : {  
"total" : 3290,  
"primaries" : 1645,  
"replication" : 1.0,  
"index" : {  
"shards" : {  
"min" : 10,  
"max" : 10,  
"avg" : 10.0  
},  
"primaries" : {  
"min" : 5,  
"max" : 5,  
"avg" : 5.0  
},  
"replication" : {  
"min" : 1.0,  
"max" : 1.0,  
"avg" : 1.0  
}  
}  
},  
"docs" : {  
"count" : 10358677517,  
"deleted" : 0  
},  
"store" : {  
"size\_in\_bytes" : 6704778880187  
},  
"fielddata" : {  
"memory\_size\_in\_bytes" : 62723570200,  
"evictions" : 0  
},  
"query\_cache" : {  
"memory\_size\_in\_bytes" : 1195879730,  
"total\_count" : 1452057,  
"hit\_count" : 1080694,  
"miss\_count" : 371363,  
"cache\_size" : 5393,  
"cache\_count" : 10727,  
"evictions" : 5334  
},  
"completion" : {  
"size\_in\_bytes" : 0  
},  
"segments" : {  
"count" : 42867,  
"memory\_in\_bytes" : 23026343590,  
"terms\_memory\_in\_bytes" : 21794765416,  
"stored\_fields\_memory\_in\_bytes" : 970973792,  
"term\_vectors\_memory\_in\_bytes" : 0,  
"norms\_memory\_in\_bytes" : 5217344,  
"points\_memory\_in\_bytes" : 244421530,  
"doc\_values\_memory\_in\_bytes" : 10965508,  
"index\_writer\_memory\_in\_bytes" : 279531472,  
"version\_map\_memory\_in\_bytes" : 0,  
"fixed\_bit\_set\_memory\_in\_bytes" : 2592254192,  
"max\_unsafe\_auto\_id\_timestamp" : 1581278460804,  
"file\_sizes" : { }  
}  
},  
"nodes" : {  
"count" : {  
"total" : 4,  
"data" : 4,  
"coordinating\_only" : 0,  
"master" : 4,  
"ingest" : 4  
},  
"versions" : [  
"6.6.1"  
],  
"os" : {  
"available\_processors" : 96,  
"allocated\_processors" : 96,  
"names" : [  
{  
"name" : "Linux",  
"count" : 4  
}  
],  
"pretty\_names" : [  
{  
"pretty\_name" : "Red Hat Enterprise Linux",  
"count" : 4  
}  
],  
"mem" : {  
"total\_in\_bytes" : 269515407360,  
"free\_in\_bytes" : 14183038976,  
"used\_in\_bytes" : 255332368384,  
"free\_percent" : 5,  
"used\_percent" : 95  
}  
},  
"process" : {  
"cpu" : {  
"percent" : 19  
},  
"open\_file\_descriptors" : {  
"min" : 11269,  
"max" : 15789,  
"avg" : 13896  
}  
},  
"jvm" : {  
"max\_uptime\_in\_millis" : 564315186,  
"versions" : [  
{  
"version" : "1.8.0\_211",  
"vm\_name" : "Java HotSpot(TM) 64-Bit Server VM",  
"vm\_version" : "25.211-b12",  
"vm\_vendor" : "Oracle Corporation",  
"count" : 4  
}  
],  
"mem" : {  
"heap\_used\_in\_bytes" : 119341024336,  
"heap\_max\_in\_bytes" : 137438953472  
},  
"threads" : 978  
},  
"fs" : {  
"total\_in\_bytes" : 50306197454848,  
"free\_in\_bytes" : 39109396488192,  
"available\_in\_bytes" : 36553692176384  
},

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [February 10, 2020, 4:53pm UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/4 "2020-02-10T16:53:48Z")

</div>

Hey @guruprasadb

could you please format that JSON in ``` for easier readability. Also, it would be nice if you made those API requests with the `?human` flag set, so that all the numbers are a little easier to digest. Happy to take a look at them then 🙂

Thanks!

---

<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:** [February 10, 2020, 6:15pm UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/5 "2020-02-10T18:15:41Z")

</div>

The first thing I would recommend is to make your heap a bit smaller. I believe it should be set to no larger than around 30GB or so in order to benefit from compressed pointers, and this should allow you to use your heap more efficiently. I would also recommend forcemerging older indices that are no longer written to as this can save a lot of heap. Please see [this webinar](https://www.elastic.co/webinars/optimizing-storage-efficiency-in-elasticsearch) for further details.

---

<div class="post-metadata">

**Author:** ![guruprasadb](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@guruprasadb](https://discuss.elastic.co/u/guruprasadb)\
**Post date:** [February 11, 2020, 6:25am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/6 "2020-02-11T06:25:38Z")

</div>

Hi @Armin_Braun,  
Pls find attached logs in the requested format

* * *

## Output of "\_cluster/stats?human&pretty"

````
```
{
  "_nodes" : {
    "total" : 4,
    "successful" : 4,
    "failed" : 0
  },
  "cluster_name" : "kca-cluster",
  "cluster_uuid" : "ntFmtDanQx2yTaivjvSPBw",
  "timestamp" : 1581396654650,
  "status" : "green",
  "indices" : {
    "count" : 332,
    "shards" : {
      "total" : 3320,
      "primaries" : 1660,
      "replication" : 1.0,
      "index" : {
        "shards" : {
          "min" : 10,
          "max" : 10,
          "avg" : 10.0
        },
        "primaries" : {
          "min" : 5,
          "max" : 5,
          "avg" : 5.0
        },
        "replication" : {
          "min" : 1.0,
          "max" : 1.0,
          "avg" : 1.0
        }
      }
    },
    "docs" : {
      "count" : 10434559500,
      "deleted" : 0
    },
    "store" : {
      "size" : "6.1tb",
      "size_in_bytes" : 6753453428508
    },
    "fielddata" : {
      "memory_size" : "58.8gb",
      "memory_size_in_bytes" : 63140716128,
      "evictions" : 0
    },
    "query_cache" : {
      "memory_size" : "1gb",
      "memory_size_in_bytes" : 1108472389,
      "total_count" : 2621091,
      "hit_count" : 1871281,
      "miss_count" : 749810,
      "cache_size" : 5002,
      "cache_count" : 12011,
      "evictions" : 7009
    },
    "completion" : {
      "size" : "0b",
      "size_in_bytes" : 0
    },
    "segments" : {
      "count" : 43207,
      "memory" : "21.5gb",
      "memory_in_bytes" : 23179911513,
      "terms_memory" : "20.4gb",
      "terms_memory_in_bytes" : 21939195688,
      "stored_fields_memory" : "932.8mb",
      "stored_fields_memory_in_bytes" : 978138000,
      "term_vectors_memory" : "0b",
      "term_vectors_memory_in_bytes" : 0,
      "norms_memory" : "5mb",
      "norms_memory_in_bytes" : 5256512,
      "points_memory" : "234.7mb",
      "points_memory_in_bytes" : 246197805,
      "doc_values_memory" : "10.6mb",
      "doc_values_memory_in_bytes" : 11123508,
      "index_writer_memory" : "263.5mb",
      "index_writer_memory_in_bytes" : 276315584,
      "version_map_memory" : "0b",
      "version_map_memory_in_bytes" : 0,
      "fixed_bit_set" : "2.4gb",
      "fixed_bit_set_memory_in_bytes" : 2611245704,
      "max_unsafe_auto_id_timestamp" : 1581374361483,
      "file_sizes" : { }
    }
  },
  "nodes" : {
    "count" : {
      "total" : 4,
      "data" : 4,
      "coordinating_only" : 0,
      "master" : 4,
      "ingest" : 4
    },
    "versions" : [
      "6.6.1"
    ],
    "os" : {
      "available_processors" : 96,
      "allocated_processors" : 96,
      "names" : [
        {
          "name" : "Linux",
          "count" : 4
        }
      ],
      "pretty_names" : [
        {
          "pretty_name" : "Red Hat Enterprise Linux",
          "count" : 4
        }
      ],
      "mem" : {
        "total" : "251gb",
        "total_in_bytes" : 269515407360,
        "free" : "6.5gb",
        "free_in_bytes" : 7033028608,
        "used" : "244.4gb",
        "used_in_bytes" : 262482378752,
        "free_percent" : 3,
        "used_percent" : 97
      }
    },
    "process" : {
      "cpu" : {
        "percent" : 14
      },
      "open_file_descriptors" : {
        "min" : 11318,
        "max" : 16368,
        "avg" : 14139
      }
    },
    "jvm" : {
      "max_uptime" : "7.3d",
      "max_uptime_in_millis" : 636359888,
      "versions" : [
        {
          "version" : "1.8.0_211",
          "vm_name" : "Java HotSpot(TM) 64-Bit Server VM",
          "vm_version" : "25.211-b12",
          "vm_vendor" : "Oracle Corporation",
          "count" : 4
        }
      ],
      "mem" : {
        "heap_used" : "111.1gb",
        "heap_used_in_bytes" : 119387408584,
        "heap_max" : "128gb",
        "heap_max_in_bytes" : 137438953472
      },
      "threads" : 974
    },
    "fs" : {
      "total" : "45.7tb",
      "total_in_bytes" : 50306197454848,
      "free" : "35.4tb",
      "free_in_bytes" : 38951136686080,
      "available" : "33.1tb",
      "available_in_bytes" : 36395432374272
    },
```

````

* * *

## Output of "\_cat/nodes?human&v""

ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
10.137.72.19 91 98 5 0.69 0.82 1.01 mdi - node-3  
10.137.72.17 91 97 4 0.21 0.69 0.92 mdi - node-1  
10.137.72.18 92 98 4 0.59 0.78 1.04 mdi \* node-2  
10.137.72.10 81 96 6 0.88 1.21 1.28 mdi - node-4

* * *

## Output of "\_nodes/stats/indices?human&pretty"

````
```
     "query_cache" : {
          "memory_size" : "250.8mb",
          "memory_size_in_bytes" : 263086511,
          "total_count" : 783703,
          "hit_count" : 560697,
          "miss_count" : 223006,
          "cache_size" : 948,
          "cache_count" : 2961,
          "evictions" : 2013
        },
        "fielddata" : {
          "memory_size" : "14.6gb",
          "memory_size_in_bytes" : 15712232712,
          "evictions" : 0
        },
        "completion" : {
          "size" : "0b",
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 10858,
          "memory" : "5.3gb",
          "memory_in_bytes" : 5782855402,
          "terms_memory" : "5gb",
          "terms_memory_in_bytes" : 5472597131,
          "stored_fields_memory" : "232.9mb",
          "stored_fields_memory_in_bytes" : 244258304,
          "term_vectors_memory" : "0b",
          "term_vectors_memory_in_bytes" : 0,
          "norms_memory" : "1.2mb",
          "norms_memory_in_bytes" : 1305344,
          "points_memory" : "58.9mb",
          "points_memory_in_bytes" : 61864839,
          "doc_values_memory" : "2.6mb",
          "doc_values_memory_in_bytes" : 2829784,
          "index_writer_memory" : "92.6mb",
          "index_writer_memory_in_bytes" : 97185564,
          "version_map_memory" : "0b",
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set" : "622.6mb",
          "fixed_bit_set_memory_in_bytes" : 652867000,
          "max_unsafe_auto_id_timestamp" : 1581372833159,
          "file_sizes" : { }
        },
        "translog" : {
          "operations" : 5364685,
          "size" : "3.2gb",
          "size_in_bytes" : 3525966678,
          "uncommitted_operations" : 1710702,
          "uncommitted_size" : "878.8mb",
          "uncommitted_size_in_bytes" : 921504154,
          "earliest_last_modified_age" : 0
        },
        "request_cache" : {
          "memory_size" : "103mb",
          "memory_size_in_bytes" : 108006529,
          "evictions" : 0,
          "hit_count" : 779,
          "miss_count" : 26761
        },
```
````

---

<div class="post-metadata">

**Author:** ![guruprasadb](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@guruprasadb](https://discuss.elastic.co/u/guruprasadb)\
**Post date:** [February 11, 2020, 7:59am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/7 "2020-02-11T07:59:28Z")

</div>

Thank you for the reply @ [Christian\_Dahlqvist]. I have some more queries.

1. Is it recommended to use both Freeze Index and Force Merging the Segments to a Single Segment. Will Freeze index have any additional benefits?

2. There is about 2TB of data with 3.5 Billion Documents for querying with 30 days of data. The cardinality of some of the Terms is in the order of 10 million. We have queries involving nested aggregation queries with 3-4 levels of nesting. Considering these, how many HOT nodes are recommended and typical sizing needed for these nodes. [I have shared the current system statistics]

---

<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:** [February 11, 2020, 8:07am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/8 "2020-02-11T08:07:19Z")

</div>

I don’t think anyone can answer that. You need to test and benchmark.

Freezing indices that are rarely queried will reduce heap usage at the expense of query performance.

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [February 12, 2020, 5:55am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/9 "2020-02-12T05:55:36Z")

</div>

As @Christian_Dahlqvist points out, the concrete performance and resource needs you'll have to experiment out yourself, we can't guess/estimate them easily from afar, there's just too many variables playing into this.

> [@guruprasadb](#):
>
> Will Freeze index have any additional benefits?

Yes, as posted above you will save significantly on memory e.g. the following

> [@guruprasadb](#):
>
> "memory\_size" : "14.6gb",

will not be loaded on heap constantly or frozen indices. This will however also significantly reduce query performance but as I said may be a valid tradeoff in your use case.

---

<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:** [March 11, 2020, 5:58am UTC](https://discuss.elastic.co/t/elasticsearch-memory-consumption/218336/10 "2020-03-11T05:58:58Z")

</div>

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