Hello Experts,
ES : 6.4
We have 21 data nodes cluster. Seeing high memory consumed by segments.terms_memory_in_bytes which causing circuit breaker issues for us. Wanted to understand why segments are taking so much memory? Referred some old discussions, do we need to force merge shards to reduce the segments and get rid of deleted documents to reduce the term_memory_in_bytes. Dynamic mapping used for indices. approx 300 fields per index, most of the fields are notanalyzed (i.e keyword fields)
Number of segments: 128431
total number of docs: 53410044582 (as per _cat/segments output)
number of deleted docs: 3022763394 (as per _cat/segments output)
Number of shards approx 7K
Seeing many segments with compound false state however not sure whether it can impact the memory or not.
Total amount of memory taken by segments is 220GB as per sum of size.memory output from _cat/segments.
From ES documentation
compound (Default) If true, the segment is stored in a compound file. This means Lucene merged all files from the segment in a single file to save file descriptors.