# Disk usage grows indefinitely over time

**URL:** <https://discuss.elastic.co/t/disk-usage-grows-indefinitely-over-time/349751>\
**Category:** Elasticsearch\
**Created:** [December 20, 2023, 8:22pm UTC](https://discuss.elastic.co/t/disk-usage-grows-indefinitely-over-time/349751 "2023-12-20T20:22:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tommaso\_Parisi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tommaso_parisi/32/123129_2.png) [@Tommaso\_Parisi](https://discuss.elastic.co/u/Tommaso_Parisi)\
**Post date:** [December 20, 2023, 8:22pm UTC](https://discuss.elastic.co/t/disk-usage-grows-indefinitely-over-time/349751/1 "2023-12-20T20:22:23Z")

</div>

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

Hello,  
as you see in the screenshot above the disk usage of my index grows indefinitely over time. If I close the index and then reopen it the usage drops, as you can see from the graph. I did a \_close followed by a \_open at 00, 07 and 16.

My application does a lot of replaces, but not many inserts. I except to see the disk usage grow a little, but the merging should inhibit it from growing too much.  
I checked the \_cat/shards and \_cat/segments api and it seems to me that the segments are correctly merged.

I don't understand why a close of the index should free disk space, but is the only method I have found to stop elastic from saturating all the available disk space. (also restarting the nodes work)

This phenomenon started after upgrading from elastic7 to elastic 8.11.1  
I have tried to create a new index from scratch (using api \_reindex) but it persist.  
Do you have any suggestion?

Thanks  
Tommaso

---

<div class="post-metadata">

**Author:** ![yago82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yago82/32/97755_2.png) [@yago82](https://discuss.elastic.co/u/yago82)\
**Post date:** [December 21, 2023, 6:05pm UTC](https://discuss.elastic.co/t/disk-usage-grows-indefinitely-over-time/349751/2 "2023-12-21T18:05:51Z")

</div>

Hi Tommaso,

You can find indices with a high deleted documents count. You can do this by running the following command:

```auto
GET _cat/indices?v&h=index,docs.count,docs.deleted&s=dd:desc

```

Then you can run a force merge with `only_expunge_deletes=true` on indices with a high deleted documents count. This will remove the deleted documents from your index and potentially free up some disk space.

Regards

---

<div class="post-metadata">

**Author:** ![Tommaso\_Parisi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tommaso_parisi/32/123129_2.png) [@Tommaso\_Parisi](https://discuss.elastic.co/u/Tommaso_Parisi)\
**Post date:** [December 22, 2023, 1:29pm UTC](https://discuss.elastic.co/t/disk-usage-grows-indefinitely-over-time/349751/3 "2023-12-22T13:29:14Z")

</div>

Thanks for the suggestion, I tried the forcemerge but it did not help.

In the end it seems that the indexes were fine. The servers where elasticsearch runs were not updated with the latest patches.  
We did an upgrade of the linux kernel (same revision but different patch release) and now it is working fine.

---

<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:** [January 19, 2024, 1:30pm UTC](https://discuss.elastic.co/t/disk-usage-grows-indefinitely-over-time/349751/4 "2024-01-19T13:30:00Z")

</div>

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