# Disk usage of gateway

**URL:** <https://discuss.elastic.co/t/disk-usage-of-gateway/3365>\
**Category:** Elasticsearch\
**Created:** [September 24, 2010, 11:09am UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365 "2010-09-24T11:09:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Degtiariov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_degtiariov/32/3223_2.png) [@Andrew\_Degtiariov](https://discuss.elastic.co/u/Andrew_Degtiariov)\
**Post date:** [September 24, 2010, 11:09am UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/1 "2010-09-24T11:09:35Z")

</div>

Hello!

Today I'm receive an alert about no free space on 100Gb EBS partition  
which I use as "work" directory for single node ES installation.  
98Gb was used by gateway. Data for ES produced from MongoDB and takes  
all with indexes and other data which is not indexed in ES only 11Gb.  
I have moved all data of gateway to /mnt partition (it have 500Gb) and  
start ES again but shutting down ES when it hold more 30 minutes in  
recovery state.  
For example full indexation takes only 25 minutes and now gateway  
occupy only 22 Gb (21 Gb after optimizing of indexes).

Is there a way to get clean up gateway? And is there a way to decrease  
time of index recovery?

--  
Andrew Degtiariov  
DA-RIPE

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 24, 2010, 5:02pm UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/2 "2010-09-24T17:02:26Z")

</div>

The gateway should get cleaned up automatically. Are you storing both the  
gateway and the work dir in the same location?

On Fri, Sep 24, 2010 at 1:09 PM, Andrew Degtiariov \<  
[andrew.degtiariov@gmail.com](mailto:andrew.degtiariov@gmail.com)\> wrote:

> Hello!
> 
> Today I'm receive an alert about no free space on 100Gb EBS partition  
> which I use as "work" directory for single node ES installation.  
> 98Gb was used by gateway. Data for ES produced from MongoDB and takes  
> all with indexes and other data which is not indexed in ES only 11Gb.  
> I have moved all data of gateway to /mnt partition (it have 500Gb) and  
> start ES again but shutting down ES when it hold more 30 minutes in  
> recovery state.  
> For example full indexation takes only 25 minutes and now gateway  
> occupy only 22 Gb (21 Gb after optimizing of indexes).
> 
> Is there a way to get clean up gateway? And is there a way to decrease  
> time of index recovery?
> 
> --  
> Andrew Degtiariov  
> DA-RIPE

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [September 24, 2010, 5:35pm UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/3 "2010-09-24T17:35:15Z")

</div>

We noticed that our work/gateway sizes were ballooning and it appeared  
that the "flush" command was not getting executed often enough. From  
the ES docs, this gets executed based on memory heuristics. Not sure  
what type of memory (disk or ram) or what the thresholds are, though.

We ended up calling flush after every 10K docs.

Regards,  
Paul

On Sep 24, 11:02 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> The gateway should get cleaned up automatically. Are you storing both the  
> gateway and the work dir in the same location?
> 
> On Fri, Sep 24, 2010 at 1:09 PM, Andrew Degtiariov \<
> 
> [andrew.degtiar...@gmail.com](mailto:andrew.degtiar...@gmail.com)\> wrote:
> 
> > Hello!
> 
> > Today I'm receive an alert about no free space on 100Gb EBS partition  
> > which I use as "work" directory for single node ES installation.  
> > 98Gb was used by gateway. Data for ES produced from MongoDB and takes  
> > all with indexes and other data which is not indexed in ES only 11Gb.  
> > I have moved all data of gateway to /mnt partition (it have 500Gb) and  
> > start ES again but shutting down ES when it hold more 30 minutes in  
> > recovery state.  
> > For example full indexation takes only 25 minutes and now gateway  
> > occupy only 22 Gb (21 Gb after optimizing of indexes).
> 
> > Is there a way to get clean up gateway? And is there a way to decrease  
> > time of index recovery?
> 
> > --  
> > Andrew Degtiariov  
> > DA-RIPE

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [September 24, 2010, 5:53pm UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/4 "2010-09-24T17:53:16Z")

</div>

On Fri, 2010-09-24 at 10:35 -0700, Paul wrote:

> We noticed that our work/gateway sizes were ballooning and it appeared  
> that the "flush" command was not getting executed often enough. From  
> the ES docs, this gets executed based on memory heuristics. Not sure  
> what type of memory (disk or ram) or what the thresholds are, though.
> 
> We ended up calling flush after every 10K docs.

By default, flush is called every 5000 operations - this is on a per  
shard basis.

This number can be controlled by setting:

index.translog.flush\_threshold

I can't find docs for this, but see this message:  
[http://groups.google.com/a/elasticsearch.com/group/users/msg/06d62ea3ceb4db30](http://groups.google.com/a/elasticsearch.com/group/users/msg/06d62ea3ceb4db30)

clint

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [September 24, 2010, 6:49pm UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/5 "2010-09-24T18:49:47Z")

</div>

Thanks Clinton! That is good to know. So, I if you have lots of  
indexes, you might want to lower this default.

On Sep 24, 11:53 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Fri, 2010-09-24 at 10:35 -0700, Paul wrote:
> 
> > We noticed that our work/gateway sizes were ballooning and it appeared  
> > that the "flush" command was not getting executed often enough. From  
> > the ES docs, this gets executed based on memory heuristics. Not sure  
> > what type of memory (disk or ram) or what the thresholds are, though.
> 
> > We ended up calling flush after every 10K docs.
> 
> By default, flush is called every 5000 operations - this is on a per  
> shard basis.
> 
> This number can be controlled by setting:
> 
> index.translog.flush\_threshold
> 
> I can't find docs for this, but see this message:[http://groups.google.com/a/elasticsearch.com/group/users/msg/06d62ea3](http://groups.google.com/a/elasticsearch.com/group/users/msg/06d62ea3)...
> 
> clint

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 24, 2010, 7:04pm UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/6 "2010-09-24T19:04:31Z")

</div>

There is a problem in 0.10 where the translog in the gateway was not being  
appended correctly and data was getting accumelated each time instead of  
adding just the diff. This does not affect the correctness of the gateway,  
but does imply more storage needs. I have fixed in in 0.11.

On Fri, Sep 24, 2010 at 8:49 PM, Paul [ppearcy@gmail.com](mailto:ppearcy@gmail.com) wrote:

> Thanks Clinton! That is good to know. So, I if you have lots of  
> indexes, you might want to lower this default.
> 
> On Sep 24, 11:53 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:
> 
> > On Fri, 2010-09-24 at 10:35 -0700, Paul wrote:
> > 
> > > We noticed that our work/gateway sizes were ballooning and it appeared  
> > > that the "flush" command was not getting executed often enough. From  
> > > the ES docs, this gets executed based on memory heuristics. Not sure  
> > > what type of memory (disk or ram) or what the thresholds are, though.
> > 
> > > We ended up calling flush after every 10K docs.
> > 
> > By default, flush is called every 5000 operations - this is on a per  
> > shard basis.
> > 
> > This number can be controlled by setting:
> > 
> > index.translog.flush\_threshold
> > 
> > I can't find docs for this, but see this message:  
> > [http://groups.google.com/a/elasticsearch.com/group/users/msg/06d62ea3](http://groups.google.com/a/elasticsearch.com/group/users/msg/06d62ea3)...
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![Andrew\_Degtiariov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_degtiariov/32/3223_2.png) [@Andrew\_Degtiariov](https://discuss.elastic.co/u/Andrew_Degtiariov)\
**Post date:** [September 29, 2010, 1:08pm UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/7 "2010-09-29T13:08:17Z")

</div>

On Fri, Sep 24, 2010 at 8:02 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> The gateway should get cleaned up automatically. Are you storing both the  
> gateway and the work dir in the same location?

Sorry for delayed reply.  
Yes, we are store both gateway and work dir in the same location. After  
moving work dir (with gateway) to 500Gb partion ES was fill it in 3 days.  
So I was force to disable gateway (and full indexation in my case in 3x  
times faster then recovering from gateway).

--  
Andrew Degtiariov  
DA-RIPE

---

<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, 4:18am UTC](https://discuss.elastic.co/t/disk-usage-of-gateway/3365/8 "2017-07-06T04:18:45Z")

</div>


