# Disk capacity for elasticsearch

**URL:** <https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816>\
**Category:** Elasticsearch\
**Created:** [November 22, 2021, 3:05pm UTC](https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816 "2021-11-22T15:05:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kapila](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kapila/32/84671_2.png) [@Kapila](https://discuss.elastic.co/u/Kapila)\
**Post date:** [November 22, 2021, 3:05pm UTC](https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816/1 "2021-11-22T15:05:56Z")

</div>

I want to ship my application log files into Elasticsearch and trying to come-up with a capacity plan for Elasticsearch.

Let's say if I have 1 GB log file, how much disk space I need for Elasticsearch to store log contents?

Is it possible to compress data in Elasticsearch to reduce the size?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 22, 2021, 3:14pm UTC](https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816/2 "2021-11-22T15:14:27Z")

</div>

[Here](https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-disk-usage.html) is a nice section for tuning for disk usage.

How much space your exact logs will take you will need to configure and test.

---

<div class="post-metadata">

**Author:** ![Kapila](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kapila/32/84671_2.png) [@Kapila](https://discuss.elastic.co/u/Kapila)\
**Post date:** [November 22, 2021, 4:04pm UTC](https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816/4 "2021-11-22T16:04:27Z")

</div>

Thanks for the reply but I need to understand the logic to calculate the capacity for Elasticsearch based on the size of the log file

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 22, 2021, 4:22pm UTC](https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816/5 "2021-11-22T16:22:25Z")

</div>

It depends on your log types... yes it does and that is why you need to test.

But the very ...very... very simplest ..... **IF ... and that is a BIG IF you logs are normal text log lines that are 500 bytes or so of text and fields etc.**..

With all the mapping, ingest, fields, conversion, keeping `_source`, compression etc ... turns our a very simple rule of thumb it turns out a starting point is _ **about** _ 1:1 of raw logs to disk space ... with the replica for HA that will be 1:2 raw logs to disk space.

Then you need to leave some disk overhead we usually say only use 85% or so of disk.

So the very simple basic equation is.... there are _ **many variables** _ that can affect that.

`Total Disk Space Needed = (GB / Day of Raw Logs * 2 ( 1 primary + 1 replica) * number of Days)/(.85 disk space watermark)`

Example 10 GB / Day with 1 Replica for 30 days

`Total Disk Space = (10 GB / Day * 2 * 30 days) (0.85 Disk Space) = 705GB Total Disk Space`

And in case I did not say it ... you need to test 😉

Edited a bit changed to "a starting point" ... see David's Below...

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [November 22, 2021, 4:25pm UTC](https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816/6 "2021-11-22T16:25:37Z")

</div>

> [@stephenb](#):
>
> a very simple rule of thumb it turns out to be _ **about** _ 1:1 of raw logs to disk space

Here's a blog post with some more detail on how variable this ratio can be, as a function of the content of the data and how it's being indexed:

> **[The true story behind Elasticsearch storage requirements](https://www.elastic.co/blog/elasticsearch-storage-the-true-story)**

TLDR it could be ~50%, it could be ~130%, it depends on a lot of things.

---

<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:** [December 20, 2021, 4:25pm UTC](https://discuss.elastic.co/t/disk-capacity-for-elasticsearch/289816/7 "2021-12-20T16:25:49Z")

</div>

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