# RE: calculating amount of disk space used

**URL:** <https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686>\
**Category:** Elasticsearch\
**Created:** [February 10, 2013, 2:20pm UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686 "2013-02-10T14:20:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elastic\_Noob](https://avatars.discourse-cdn.com/v4/letter/e/67e7ee/32.png) [@Elastic\_Noob](https://discuss.elastic.co/u/Elastic_Noob)\
**Post date:** [February 10, 2013, 2:20pm UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686/1 "2013-02-10T14:20:24Z")

</div>

Hi good day,

I was wondering how can i calculate the amount of disk space used by  
Elastic Search?

Here's an example:

I collected 1 million tweets, using the index "tweets" and I indexed the  
"text" and "users" key.

So my 2 questions are:

1. In this situation, how do i find out the amount of disk space used  
the the "tweets" index?
2. Is there any way I can find out the amount of diskspace used by  
tweets that contain the hashtag "#YOLO" for example?

Thanks everyone!

Best.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [February 10, 2013, 2:46pm UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686/2 "2013-02-10T14:46:05Z")

</div>

1. The Indices Stats API[http://www.elasticsearch.org/guide/reference/api/admin-indices-stats.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-stats.html)can help you out there. Note, this is only the size of the primaries, not  
the replicas too (although that's easy to calculate on your own)

$ curl localhost:9200/test/\_stats  
{  
"ok": true,  
"\_shards": {  
"total": 6,  
"successful": 6,  
"failed": 0  
}  
[...]  
"indices": {  
"test": {  
"primaries": {  
"docs": {  
"count": 7356989,  
"deleted": 628485  
},  
"store": {  
"size": "8.7gb",  
"size\_in\_bytes": 9443315781,  
"throttle\_time": "0s",  
"throttle\_time\_in\_millis": 0  
}  
[...]

1. I do not believe this is possible, at least not through the API. If  
you know the average size of each tweet, you could use the Count API and  
multiply the count by average doc size.

-Zach

On Sunday, February 10, 2013 9:20:24 AM UTC-5, Elastic Noob wrote:

> Hi good day,
> 
> I was wondering how can i calculate the amount of disk space used by  
> Elastic Search?
> 
> Here's an example:
> 
> I collected 1 million tweets, using the index "tweets" and I indexed the  
> "text" and "users" key.
> 
> So my 2 questions are:
> 
> 1. In this situation, how do i find out the amount of disk space used  
> the the "tweets" index?
> 2. Is there any way I can find out the amount of diskspace used by  
> tweets that contain the hashtag "#YOLO" for example?
> 
> Thanks everyone!
> 
> Best.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Elastic\_Noob](https://avatars.discourse-cdn.com/v4/letter/e/67e7ee/32.png) [@Elastic\_Noob](https://discuss.elastic.co/u/Elastic_Noob)\
**Post date:** [February 12, 2013, 9:50am UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686/3 "2013-02-12T09:50:58Z")

</div>

Hi,

thanks for the tip!

Best Regards,  
Eugene

On Sunday, February 10, 2013 10:46:05 PM UTC+8, Zachary Tong wrote:

> 1. The Indices Stats API[http://www.elasticsearch.org/guide/reference/api/admin-indices-stats.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-stats.html)can help you out there. Note, this is only the size of the primaries, not  
> the replicas too (although that's easy to calculate on your own)
> 
> $ curl localhost:9200/test/\_stats  
> {  
> "ok": true,  
> "\_shards": {  
> "total": 6,  
> "successful": 6,  
> "failed": 0  
> }  
> [...]  
> "indices": {  
> "test": {  
> "primaries": {  
> "docs": {  
> "count": 7356989,  
> "deleted": 628485  
> },  
> "store": {  
> "size": "8.7gb",  
> "size\_in\_bytes": 9443315781,  
> "throttle\_time": "0s",  
> "throttle\_time\_in\_millis": 0  
> }  
> [...]
> 
> 1. I do not believe this is possible, at least not through the API.  
> If you know the average size of each tweet, you could use the Count API  
> and multiply the count by average doc size.
> 
> -Zach
> 
> On Sunday, February 10, 2013 9:20:24 AM UTC-5, Elastic Noob wrote:
> 
> > Hi good day,
> > 
> > I was wondering how can i calculate the amount of disk space used by  
> > Elastic Search?
> > 
> > Here's an example:
> > 
> > I collected 1 million tweets, using the index "tweets" and I indexed the  
> > "text" and "users" key.
> > 
> > So my 2 questions are:
> > 
> > 1. In this situation, how do i find out the amount of disk space used  
> > the the "tweets" index?
> > 2. Is there any way I can find out the amount of diskspace used by  
> > tweets that contain the hashtag "#YOLO" for example?
> > 
> > Thanks everyone!
> > 
> > Best.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Elastic\_Noob](https://avatars.discourse-cdn.com/v4/letter/e/67e7ee/32.png) [@Elastic\_Noob](https://discuss.elastic.co/u/Elastic_Noob)\
**Post date:** [February 15, 2013, 12:26pm UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686/4 "2013-02-15T12:26:54Z")

</div>

Hi again,

i was wondering if the size of the index reflect the size of the total  
amount of disk space used by the dataset? ( including the raw \_source data  
) ?

Thanks again!

On Sunday, February 10, 2013 10:46:05 PM UTC+8, Zachary Tong wrote:

> 1. The Indices Stats API[http://www.elasticsearch.org/guide/reference/api/admin-indices-stats.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-stats.html)can help you out there. Note, this is only the size of the primaries, not  
> the replicas too (although that's easy to calculate on your own)
> 
> $ curl localhost:9200/test/\_stats  
> {  
> "ok": true,  
> "\_shards": {  
> "total": 6,  
> "successful": 6,  
> "failed": 0  
> }  
> [...]  
> "indices": {  
> "test": {  
> "primaries": {  
> "docs": {  
> "count": 7356989,  
> "deleted": 628485  
> },  
> "store": {  
> "size": "8.7gb",  
> "size\_in\_bytes": 9443315781,  
> "throttle\_time": "0s",  
> "throttle\_time\_in\_millis": 0  
> }  
> [...]
> 
> 1. I do not believe this is possible, at least not through the API.  
> If you know the average size of each tweet, you could use the Count API  
> and multiply the count by average doc size.
> 
> -Zach
> 
> On Sunday, February 10, 2013 9:20:24 AM UTC-5, Elastic Noob wrote:
> 
> > Hi good day,
> > 
> > I was wondering how can i calculate the amount of disk space used by  
> > Elastic Search?
> > 
> > Here's an example:
> > 
> > I collected 1 million tweets, using the index "tweets" and I indexed the  
> > "text" and "users" key.
> > 
> > So my 2 questions are:
> > 
> > 1. In this situation, how do i find out the amount of disk space used  
> > the the "tweets" index?
> > 2. Is there any way I can find out the amount of diskspace used by  
> > tweets that contain the hashtag "#YOLO" for example?
> > 
> > Thanks everyone!
> > 
> > Best.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [February 15, 2013, 2:56pm UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686/5 "2013-02-15T14:56:30Z")

</div>

Elastic Noob wrote:

> i was wondering if the size of the index reflect the size of the  
> total amount of disk space used by the dataset? ( including the raw  
> \_source data ) ?

You want the total -\> store -\> size(\_in\_bytes). It should reflect  
the total usage of your index's shards across all disks (primaries +  
replicas).

Here's a simple way to get this number without looking through the  
json.

% curl -s [download.elasticsearch.org/es2unix/es](http://download.elasticsearch.org/es2unix/es) \>~/bin/es; chmod +x ~/bin/es  
% es indices -v wik  
status name pri rep size bytes docs  
green wiki 5 1 5.3gb 5731796207 753816

-Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Elastic\_Noob](https://avatars.discourse-cdn.com/v4/letter/e/67e7ee/32.png) [@Elastic\_Noob](https://discuss.elastic.co/u/Elastic_Noob)\
**Post date:** [February 17, 2013, 6:31am UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686/6 "2013-02-17T06:31:14Z")

</div>

WOW.

cool!

Thanks!

On Friday, February 15, 2013 10:56:30 PM UTC+8, Drew Raines wrote:

> Elastic Noob wrote:
> 
> > i was wondering if the size of the index reflect the size of the  
> > total amount of disk space used by the dataset? ( including the raw  
> > \_source data ) ?
> 
> You want the total -\> store -\> size(\_in\_bytes). It should reflect  
> the total usage of your index's shards across all disks (primaries +  
> replicas).
> 
> Here's a simple way to get this number without looking through the  
> json.
> 
> % curl -s [download.elasticsearch.org/es2unix/es](http://download.elasticsearch.org/es2unix/es) \>~/bin/es; chmod +x  
> ~/bin/es  
> % es indices -v wik  
> status name pri rep size bytes docs  
> green wiki 5 1 5.3gb 5731796207 753816
> 
> -Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:51am UTC](https://discuss.elastic.co/t/re-calculating-amount-of-disk-space-used/10686/7 "2017-07-06T02:51:10Z")

</div>


