# Segments count и Heap size

**URL:** <https://discuss.elastic.co/t/segments-count-heap-size/65767>\
**Category:** Вопросы на русском языке\
**Created:** [November 11, 2016, 8:14am UTC](https://discuss.elastic.co/t/segments-count-heap-size/65767 "2016-11-11T08:14:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rusty](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rusty](https://discuss.elastic.co/u/rusty)\
**Post date:** [November 11, 2016, 10:01am UTC](https://discuss.elastic.co/t/segments-count-heap-size/65767/2 "2016-11-11T10:01:25Z")

</div>

Привет, папки с индексами можно не перемещать, достаточно закрыть "ненужные" индексы. Сегментов действительно много, но надо смотреть что показывает статистика по ноде:

> [@ELK suddenly colapsed](https://discuss.elastic.co/t/elk-suddenly-colapsed/48414/4):
>
> You can also can close unused indexes (their data become unavailable, but it would free up the memory) Run curl -XGET "localhost:9200/\_stats?pretty" and get a look at all - segments - memory\_in\_bytes. Divide memory\_in\_bytes by number of nodes and you'll get rough estimation of memory consumption on each node. For more details, please, follow these links: [topic1](https://discuss.elastic.co/t/segments-memory-in-bytes-excessively-large-with-allot-of-open-indices/40622), [topic2](https://discuss.elastic.co/t/segments-memory-in-bytes-goes-down-after-reduction-of-segments-restart/41258)

и хороший коммент про минусы закрытия индексов:

> [@ELK suddenly colapsed](https://discuss.elastic.co/t/elk-suddenly-colapsed/48414/5):
>
> Don't do that unless you have to though: closed indices are no longer managed by ES. Meaning if a node dies with closed index shards, they will not be recovered elsewhere. Say you close an index for 2 months and you had 2 node failures in that time .. it could just be that both primary and replica shard X were discarded and never recovered. You try to open the index one day and voila: it's Red and you lost data. Just saying wink

---

_[View the full topic](https://discuss.elastic.co/t/segments-count-heap-size/65767)._
