# How long does it take to expunge deleted documents?

**URL:** https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678
**Category:** Elasticsearch
**Created:** [February 1, 2016, 10:20pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678 "2016-02-01T22:20:57Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![hwang251](https://avatars.discourse-cdn.com/v4/letter/h/2acd7d/32.png) [@hwang251](https://discuss.elastic.co/u/hwang251)
#### Post date: [February 1, 2016, 10:20pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/1 "2016-02-01T22:20:57Z")

</div>

I'm trying to expunge deleted documents from our cluster. When I try to use the optimize API through curl, I usually get a 504 gateway timeout. And after the call, I usually see my store size grows in size. How long should I expect to wait until my deleted documents are expunged?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 2, 2016, 5:33am UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/2 "2016-02-02T05:33:47Z")

</div>

Depends on things like how big the index is, how many deleted docs you have, how big your cluster is, is the data static.

---

<div class="post-metadata">

### Author: ![yahoo](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@yahoo](https://discuss.elastic.co/u/yahoo)
#### Post date: [February 10, 2016, 11:02pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/3 "2016-02-10T23:02:35Z")

</div>

Hi @warkolm  
I deleted 6 indices (I used for learning) each is less than 2 MB, a week ago by:  
`$ curl -XDELETE 'http://localhost:9200/logstash-*'`  
they do not show up when  
`http://127.0.0.1:9200/_cat/indices`

but the folder data still has them.

How to clean the data folder?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 11, 2016, 2:46am UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/4 "2016-02-11T02:46:01Z")

</div>

> [@yahoo](#):
>
> but the folder data still has them.

Is there anything in them?

---

<div class="post-metadata">

### Author: ![yahoo](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@yahoo](https://discuss.elastic.co/u/yahoo)
#### Post date: [February 11, 2016, 4:33pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/5 "2016-02-11T16:33:47Z")

</div>

Yes.  
There are all the stuff related to indices, with subfolders and plenty of files.  
They are available in 4 nodes.  
Each folder is 7-14 MB.  
For example:  
Here is the outcome of the  
`tree /f`  
for the 4th node  
starting form  
`cluster/nodes/4/indices/Shakespeare/`

```
-->1
    -->index
            segments_6
            write.lock
            _0.cfe
            _0.cfs
            _0.si
            _1.cfe
            _1.cfs
            _1.si
            _2.cfe
            _2.cfs
            _2.si            
    -->translog
            translog-1.tlog
            translog.ckp            
    -->_state
            state-0.st     
-->2
    -->index
            segments_5
            write.lock
            _0.cfe
            _0.cfs
            _0.si
            _1.cfe
            _1.cfs
            _1.si
            _2.cfe
            _2.cfs
            _2.si        
    -->translog
            translog-1.tlog
            translog.ckp           
    -->_state
            state-0.st           
-->_state
        state-1.st
```

---

<div class="post-metadata">

### Author: ![erikthered](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@erikthered](https://discuss.elastic.co/u/erikthered)
#### Post date: [February 26, 2016, 6:23pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/6 "2016-02-26T18:23:57Z")

</div>

We need the first six characters of your cluster ID to help you out. Also, what version of Elasticsearch are you running? (I can see the version once I get the cluster ID, but humor me in the mean time).

---

<div class="post-metadata">

### Author: ![yahoo](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@yahoo](https://discuss.elastic.co/u/yahoo)
#### Post date: [February 29, 2016, 6:52pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/7 "2016-02-29T18:52:47Z")

</div>

version[2.1.1], pid[12988], build[40e2c53/2015-12-15T13:05:55Z]

TEST\_my\_app\_clus-dev/rrLop79cRFCuo\_HliN25wA

---

<div class="post-metadata">

### Author: ![erikthered](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@erikthered](https://discuss.elastic.co/u/erikthered)
#### Post date: [February 29, 2016, 7:51pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/8 "2016-02-29T19:51:53Z")

</div>

This isn't a Elastic Cloud issue as I re-read the comments; you're able to run commands locally and we don't allow that 🙂

Moving to an appropriate forum.

---

<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 5, 2017, 11:12pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-to-expunge-deleted-documents/40678/9 "2017-07-05T23:12:47Z")

</div>


