# Is there a limit on the number of ILM Policies that can be created in a Cluster?

**URL:** <https://discuss.elastic.co/t/is-there-a-limit-on-the-number-of-ilm-policies-that-can-be-created-in-a-cluster/323398>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [January 18, 2023, 10:01am UTC](https://discuss.elastic.co/t/is-there-a-limit-on-the-number-of-ilm-policies-that-can-be-created-in-a-cluster/323398 "2023-01-18T10:01:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddhartha\_c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siddhartha_c/32/115957_2.png) [@siddhartha\_c](https://discuss.elastic.co/u/siddhartha_c)\
**Post date:** [January 18, 2023, 10:01am UTC](https://discuss.elastic.co/t/is-there-a-limit-on-the-number-of-ilm-policies-that-can-be-created-in-a-cluster/323398/1 "2023-01-18T10:01:59Z")

</div>

I have a situation where I need to create 120 indices , wherein each index has the data for a particular month.

- The data is stored for past 10 years (12 month\*10 year = 120 indices).
- Each index hold 1 month Data.
- I have a requirement wherein I need to delete the oldest 1 month data every month. Since , these are old data, there is no write operation in these indexes.
- **Question** : Can I create ILM Policies for each Index , as to when the Index completes the assigned time within the WARM phase, it moves to the DELETE phase and the Index is deleted? (Example: If an Index hold 6 years old data for Jan month, then this Index should get deleted after it completes 4 years and likewise)
- So, I will be needing around 120 ILM policies(as each Index will have unique deletion min\_age) , each policy attached to an Index and Once the Index is Deleted, we will delete the corresponding Policy .
- So, Is creation of 120 ILM Policies recommended by Elastic? and Will it effect the overall performance ?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [January 18, 2023, 1:12pm UTC](https://discuss.elastic.co/t/is-there-a-limit-on-the-number-of-ilm-policies-that-can-be-created-in-a-cluster/323398/2 "2023-01-18T13:12:09Z")

</div>

I don't think there is a limit on the number of ILM policies, you can have multiple ILM policies and 120 will work without any issue.

But I don't think you need one ILM policy for each index, if you need to delete the oldest 1 month data, just one policy should be enough.

For example, if you will have 10 years of data and monthly indices, you will have something like this:

```auto
indexname-2013-01
indexname-2013-02
indexname-2013-03
...
...
indexname-2023-01

```

Then you would have a ILM policy with a DELETE phase that would trigger after 10 years, so in February 2023 the index `indexname-2013-01` should be deleted, in March 2023, the `indexname-2013-02` should be deleted and it goes on, one policy would be enough.

The main issue here is that ILM uses the creation date of the index to control the phases, so you will need to add a setting named `index.lifecycle.origination_date` in every one of your indices with the corresponding date for the index in Unix epoch time, for example, the value of this setting for the `indexname-2013-01` would be the correspondent epoch time in miliseconds of January 1st, 2013, you can read more about this setting in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-settings.html#_index_level_settings), also read this [blog post](https://www.elastic.co/blog/control-ilm-phase-transition-timings-using-origination-date) about timing the phases.

---

<div class="post-metadata">

**Author:** ![siddhartha\_c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siddhartha_c/32/115957_2.png) [@siddhartha\_c](https://discuss.elastic.co/u/siddhartha_c)\
**Post date:** [January 19, 2023, 5:40am UTC](https://discuss.elastic.co/t/is-there-a-limit-on-the-number-of-ilm-policies-that-can-be-created-in-a-cluster/323398/3 "2023-01-19T05:40:57Z")

</div>

Thanks a lot !! you are a lifesaver . This is perfectly what we need . !!  
We will be trying out the solution .

---

<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:** [February 16, 2023, 5:41am UTC](https://discuss.elastic.co/t/is-there-a-limit-on-the-number-of-ilm-policies-that-can-be-created-in-a-cluster/323398/4 "2023-02-16T05:41:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
