When does ES free up disk space?


(Petri Lehtinen) #1

Hi!

I have a single node with zero configuration (the default). It takes
about 20GB of disk space and had 45M documents. I removed
approximately half of the documents, but no disk space was freed. I
also ran the "optimize" command by hand, but still no free space.

So, when is the disk space going to be freed up? Or is it? I'm using
version 0.11.0.

Petri Lehtinen


(Shay Banon) #2

When you delete a doc, it does not get actually deleted until the relevant internal lucene segment (a subset of the actual lucene index) that includes deletes gets merged "out". If you want to completely optimize an index, you can optimize it down into a single segment, or run the the optimize request with only_expunge_deletes set to true. Note, this will be an intensive IO operation.
On Tuesday, March 1, 2011 at 9:28 AM, Petri Lehtinen wrote:

Hi!

I have a single node with zero configuration (the default). It takes
about 20GB of disk space and had 45M documents. I removed
approximately half of the documents, but no disk space was freed. I
also ran the "optimize" command by hand, but still no free space.

So, when is the disk space going to be freed up? Or is it? I'm using
version 0.11.0.

Petri Lehtinen


(Petri Lehtinen) #3

On Mar 1, 9:05 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

When you delete a doc, it does not get actually deleted until the relevant internal lucene segment (a subset of the actual lucene index) that includes deletes gets merged "out". If you want to completely optimize an index, you can optimize it down into a single segment, or run the the optimize request with only_expunge_deletes set to true. Note, this will be an intensive IO operation.

This is what I did:

curl -XPOST 'http://localhost:9200/_optimize' -d
'{"only_expunge_deletes": true}'

It took a long time to complete, but as said before, no disk space was
freed.


(Lukáš Vlček) #4

Hi Petri,

I did not use it myself yet but based on the docs
http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize.html I
would say that the parameter is expected to be used as a URL parameter:

curl -XPOST 'localhost:9200/_optimize?only_expunge_deletes=true'

Regards,
Lukas

On Wed, Mar 2, 2011 at 7:55 AM, Petri Lehtinen petri@digip.org wrote:

On Mar 1, 9:05 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

When you delete a doc, it does not get actually deleted until the
relevant internal lucene segment (a subset of the actual lucene index) that
includes deletes gets merged "out". If you want to completely optimize an
index, you can optimize it down into a single segment, or run the the
optimize request with only_expunge_deletes set to true. Note, this will be
an intensive IO operation.

This is what I did:

curl -XPOST 'http://localhost:9200/_optimize' -d
'{"only_expunge_deletes": true}'

It took a long time to complete, but as said before, no disk space was
freed.


(Petri Lehtinen) #5

On Mar 2, 10:02 am, Lukáš Vlček lukas.vl...@gmail.com wrote:

I did not use it myself yet but based on the docshttp://www.elasticsearch.org/guide/reference/api/admin-indices-optimi...I
would say that the parameter is expected to be used as a URL parameter:

curl -XPOST 'localhost:9200/_optimize?only_expunge_deletes=true'

Wow, this worked. Thanks a lot!


(system) #6