I have Elasticsearch 1.2.2 installed on a Debian server, with ~5.3M indexed documents. When I run myindex/_stats
, I get the following info :
{
"_shards": {
"total": 10,
"successful": 5,
"failed": 0
},
"_all": {
"primaries": {
"docs": {
"count": 5306837,
"deleted": 100209
},
"store": {
"size_in_bytes": 32003706527,
"throttle_time_in_millis": 1657592
},
....
}
which tells me the total size of my documents is equal to ~ 32 GB
However, the size of the data folder in the elasticsearch folder is 72GB
From the Elasticsearch doc, I've tried running
curl -XPOST 'http://localhost:9200/myindex/_optimize?only_expunge_deletes=true'
Running this command has
- reduced the number of deleted docs from 300k to 100k (as returned by the _stats command above) but not to 0 as I would have expected
- reduced the disk usage from 90G to 72G, but not to 32G which is actual size of my documents
(note : I also ran this command on all indexes = curl -XPOST 'http://localhost:9200/_optimize?only_expunge_deletes=true
, with no significant difference)
How do I reduce the data folder size to the actual size of my documents ?