# Elasticsearch/data size reduction after restart

**URL:** <https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555>\
**Category:** Elasticsearch\
**Created:** [October 8, 2016, 8:58am UTC](https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555 "2016-10-08T08:58:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![espogian](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@espogian](https://discuss.elastic.co/u/espogian)\
**Post date:** [October 8, 2016, 8:58am UTC](https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555/1 "2016-10-08T08:58:04Z")

</div>

Hello, I'm running Elasticsearch on a Docker container. I start the container mapping the folder `/usr/share/elasticsearch/data` on a local folder in order to retain the data even if the container is destroyed.  
I have noticed that after stopping and restarting the elasticsearch container the elasticsearch/data folder size is shrinking a lot.  
However, it doesn't seem to be causing data loss, because I'm still able to see all the data on Kibana.  
I've compared the folder size before and after restarting elasticsearch and definitely there is something going on:

Compare before:

```
[...]
8.0K ./indices/logstash-apache-2016.09.09/_state
8.0K ./indices/logstash-apache-2016.09.09/3/_state
4.5M ./indices/logstash-apache-2016.09.09/3/translog
2.0M ./indices/logstash-apache-2016.09.09/3/index
6.5M ./indices/logstash-apache-2016.09.09/3
[...]

```

With after elasticsearch restart:

```
[...]
8.0K ./indices/logstash-apache-2016.09.09/_state
8.0K ./indices/logstash-apache-2016.09.09/3/_state
20K ./indices/logstash-apache-2016.09.09/3/translog
2.4M ./indices/logstash-apache-2016.09.09/3/index
2.4M ./indices/logstash-apache-2016.09.09/3
[...]

```

I would like to understand if there is something wrong I'm doing here 😐

---

<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:** [October 8, 2016, 9:03am UTC](https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555/2 "2016-10-08T09:03:22Z")

</div>

Translog will reduce because it is emptied - ie things are played and cleared.

---

<div class="post-metadata">

**Author:** ![espogian](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@espogian](https://discuss.elastic.co/u/espogian)\
**Post date:** [October 8, 2016, 9:04am UTC](https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555/3 "2016-10-08T09:04:41Z")

</div>

Thanks. Is this size reduction also performed during running time? Or I should plan these container restarts?

---

<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:** [October 8, 2016, 9:06am UTC](https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555/4 "2016-10-08T09:06:46Z")

</div>

Yes, it's constantly cleared.

---

<div class="post-metadata">

**Author:** ![espogian](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@espogian](https://discuss.elastic.co/u/espogian)\
**Post date:** [October 8, 2016, 9:17am UTC](https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555/5 "2016-10-08T09:17:55Z")

</div>

Thanks again 🙂

---

<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, 10:13pm UTC](https://discuss.elastic.co/t/elasticsearch-data-size-reduction-after-restart/62555/6 "2017-07-05T22:13:54Z")

</div>


