# Low indices.ttl.interval is NOT working

**URL:** <https://discuss.elastic.co/t/low-indices-ttl-interval-is-not-working/16108>\
**Category:** Elasticsearch\
**Created:** [March 3, 2014, 2:23pm UTC](https://discuss.elastic.co/t/low-indices-ttl-interval-is-not-working/16108 "2014-03-03T14:23:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pallavi\_Mishra](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@Pallavi\_Mishra](https://discuss.elastic.co/u/Pallavi_Mishra)\
**Post date:** [March 3, 2014, 2:23pm UTC](https://discuss.elastic.co/t/low-indices-ttl-interval-is-not-working/16108/1 "2014-03-03T14:23:44Z")

</div>

I have set 'indices.ttl.interval' to 15 sec using following curl command:

curl -XPUT localhost:9200/\_cluster/settings -d '{ "transient": {  
"indices.ttl.interval": "15s" } }'

I have checked that the value is set properly by using the CURL command  
too. However, it does NOT delete the documents from Elastic search after 15  
sec .I have gone through various related links, however there is no  
suggestion is working for me:

- 

## [https://groups.google.com/forum/#!searchin/elasticsearch/indices.ttl.interval/elasticsearch/4-\_lNiP8mps/wcKcmfWselYJ](https://groups.google.com/forum/#!searchin/elasticsearch/indices.ttl.interval/elasticsearch/4-_lNiP8mps/wcKcmfWselYJ)

## [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html)

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html)

When I try with 20-25 sec, document clean up happens randomly. Having 15  
sec is too high, ideally I expect it to work with 5 sec.

Queries:

- What do you suggest to get rid off this issue?
- What are possible causes of such failure?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0388ac73-3625-4f7f-8258-d6cdb53a0cba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0388ac73-3625-4f7f-8258-d6cdb53a0cba%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 3, 2014, 4:13pm UTC](https://discuss.elastic.co/t/low-indices-ttl-interval-is-not-working/16108/2 "2014-03-03T16:13:15Z")

</div>

Hey,

This should clarify things (the cleanup threads runs only once per minute  
by default):

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--Alex

On Mon, Mar 3, 2014 at 3:23 PM, Pallavi Mishra  
[pallavimishra018@gmail.com](mailto:pallavimishra018@gmail.com)wrote:

> I have set 'indices.ttl.interval' to 15 sec using following curl command:
> 
> curl -XPUT localhost:9200/\_cluster/settings -d '{ "transient": {  
> "indices.ttl.interval": "15s" } }'
> 
> I have checked that the value is set properly by using the CURL command  
> too. However, it does NOT delete the documents from Elastic search after 15  
> sec .I have gone through various related links, however there is no  
> suggestion is working for me:
> 
> - 
> 
> ## [Redirecting to Google Groups](https://groups.google.com/forum/#!searchin/elasticsearch/indices.ttl.interval/elasticsearch/4-_lNiP8mps/wcKcmfWselYJ)
> 
> ## [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html)
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html)
> 
> When I try with 20-25 sec, document clean up happens randomly. Having 15  
> sec is too high, ideally I expect it to work with 5 sec.
> 
> Queries:
> 
> - What do you suggest to get rid off this issue?
> - What are possible causes of such failure?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/0388ac73-3625-4f7f-8258-d6cdb53a0cba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0388ac73-3625-4f7f-8258-d6cdb53a0cba%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-eBumjs\_Bsb\_PVmOKGuCXO%3DJNUd2BsUw6SiwkAjzKMrA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-eBumjs_Bsb_PVmOKGuCXO%3DJNUd2BsUw6SiwkAjzKMrA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Pallavi\_Mishra](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@Pallavi\_Mishra](https://discuss.elastic.co/u/Pallavi_Mishra)\
**Post date:** [March 4, 2014, 5:36am UTC](https://discuss.elastic.co/t/low-indices-ttl-interval-is-not-working/16108/3 "2014-03-04T05:36:40Z")

</div>

Hi Alex,  
Thanks for response. But that is the default value and we can alter the  
value.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

.  
Do you have more information regarding this issue then please suggest.

On Monday, March 3, 2014 9:43:15 PM UTC+5:30, Alexander Reelsen wrote:

> Hey,
> 
> This should clarify things (the cleanup threads runs only once per minute  
> by default):  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html#_note_on_documents_expiration)
> 
> --Alex
> 
> On Mon, Mar 3, 2014 at 3:23 PM, Pallavi Mishra \<[pallavim...@gmail.com](mailto:pallavim...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I have set 'indices.ttl.interval' to 15 sec using following curl command:
> > 
> > curl -XPUT localhost:9200/\_cluster/settings -d '{ "transient": {  
> > "indices.ttl.interval": "15s" } }'
> > 
> > I have checked that the value is set properly by using the CURL command  
> > too. However, it does NOT delete the documents from Elastic search after 15  
> > sec .I have gone through various related links, however there is no  
> > suggestion is working for me:
> > 
> > - 
> > 
> > ## [Redirecting to Google Groups](https://groups.google.com/forum/#!searchin/elasticsearch/indices.ttl.interval/elasticsearch/4-_lNiP8mps/wcKcmfWselYJ)
> > 
> > ## [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html)
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html)
> > 
> > When I try with 20-25 sec, document clean up happens randomly. Having 15  
> > sec is too high, ideally I expect it to work with 5 sec.
> > 
> > Queries:
> > 
> > - What do you suggest to get rid off this issue?
> > - What are possible causes of such failure?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/0388ac73-3625-4f7f-8258-d6cdb53a0cba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0388ac73-3625-4f7f-8258-d6cdb53a0cba%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/df6d433a-3e94-40cc-a2dd-cfd02bec7f09%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/df6d433a-3e94-40cc-a2dd-cfd02bec7f09%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 4, 2014, 8:59am UTC](https://discuss.elastic.co/t/low-indices-ttl-interval-is-not-working/16108/4 "2014-03-04T08:59:53Z")

</div>

Hey,

wow. I only read what I wanted to read and skipped the first paragraph.  
sorry for that.

The clean up thread basically sleeps the specified interval, only when the  
interval is updated and the old sleep interval has been finished, the new  
settings are applied. This means you might need to wait an additional run  
(thats what the second sleep is doing in the below example). From then on,  
everything should work as expected.

curl -X DELETE localhost:9200/test  
curl -X PUT localhost:9200/test  
curl -X PUT localhost:9200/test/test/\_mapping -d '{ "test" : { "\_ttl" : {  
"enabled" : true } } }'  
curl -X PUT 'localhost:9200/test/test/1?ttl=30s' -d '{ "foo" : "bar" }'  
curl -X GET localhost:9200/test/test/1  
sleep 60  
curl -X GET localhost:9200/test/test/1  
curl -XPUT localhost:9200/\_cluster/settings -d '{ "transient" : {  
"indices.ttl.interval" : "15s" } }'  
sleep 60  
curl -X PUT 'localhost:9200/test/test/1?ttl=10s' -d '{ "foo" : "bar" }'  
curl -X GET localhost:9200/test/test/1  
sleep 15  
curl -X GET localhost:9200/test/test/1

If the above does not for you/in your case, there might be a bug, and I  
would like you to file an issue, with the exact steps for reproducing (like  
above). Thanks

--Alex

On Tue, Mar 4, 2014 at 6:36 AM, Pallavi Mishra  
[pallavimishra018@gmail.com](mailto:pallavimishra018@gmail.com)wrote:

> Hi Alex,  
> Thanks for response. But that is the default value and we can alter the  
> value.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html#_default)  
> .  
> Do you have more information regarding this issue then please suggest.
> 
> On Monday, March 3, 2014 9:43:15 PM UTC+5:30, Alexander Reelsen wrote:
> 
> > Hey,
> > 
> > This should clarify things (the cleanup threads runs only once per minute  
> > by default): [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > reference/current/mapping-ttl-field.html#\_note\_on\_documents\_expiration
> > 
> > --Alex
> > 
> > On Mon, Mar 3, 2014 at 3:23 PM, Pallavi Mishra [pallavim...@gmail.com](mailto:pallavim...@gmail.com)wrote:
> > 
> > > I have set 'indices.ttl.interval' to 15 sec using following curl command:
> > > 
> > > curl -XPUT localhost:9200/\_cluster/settings -d '{ "transient": {  
> > > "indices.ttl.interval": "15s" } }'
> > > 
> > > I have checked that the value is set properly by using the CURL command  
> > > too. However, it does NOT delete the documents from Elastic search after 15  
> > > sec .I have gone through various related links, however there is no  
> > > suggestion is working for me:
> > > 
> > > - [Redirecting to Google Groups](https://groups.google.com/forum/#!searchin/)  
> > > elasticsearch/indices.ttl.interval/elasticsearch/4-\_  
> > > lNiP8mps/wcKcmfWselYJ[https://groups.google.com/forum/#!searchin/elasticsearch/indices.ttl.interval/elasticsearch/4-\_lNiP8mps/wcKcmfWselYJ](https://groups.google.com/forum/#!searchin/elasticsearch/indices.ttl.interval/elasticsearch/4-_lNiP8mps/wcKcmfWselYJ)
> > > - [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > > reference/current/cluster-update-settings.html[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html)
> > > - [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > > reference/current/mapping-ttl-field.html[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html)
> > > 
> > > When I try with 20-25 sec, document clean up happens randomly. Having 15  
> > > sec is too high, ideally I expect it to work with 5 sec.
> > > 
> > > Queries:
> > > 
> > > - What do you suggest to get rid off this issue?
> > > - What are possible causes of such failure?
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/0388ac73-3625-4f7f-8258-d6cdb53a0cba%  
> > > [40googlegroups.com](http://40googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/df6d433a-3e94-40cc-a2dd-cfd02bec7f09%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/df6d433a-3e94-40cc-a2dd-cfd02bec7f09%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/df6d433a-3e94-40cc-a2dd-cfd02bec7f09%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/df6d433a-3e94-40cc-a2dd-cfd02bec7f09%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM\_JuOY2csW6aVTsQc\_qfKxg%2B1c9a1zUHVfmPRtWwXNUZA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_JuOY2csW6aVTsQc_qfKxg%2B1c9a1zUHVfmPRtWwXNUZA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:45am UTC](https://discuss.elastic.co/t/low-indices-ttl-interval-is-not-working/16108/5 "2017-07-06T01:45:54Z")

</div>


