# Is it possible to change maxmemory\_policy?

**URL:** <https://dragonfly.discourse.group/t/is-it-possible-to-change-maxmemory-policy/313>\
**Category:** Dragonfly Technical\
**Created:** [September 3, 2025, 3:39pm UTC](https://dragonfly.discourse.group/t/is-it-possible-to-change-maxmemory-policy/313 "2025-09-03T15:39:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KleinenberG](https://yyz2.discourse-cdn.com/flex004/user_avatar/dragonfly.discourse.group/kleinenberg/32/125_2.png) [@KleinenberG](https://dragonfly.discourse.group/u/KleinenberG)\
**Post date:** [September 3, 2025, 3:39pm UTC](https://dragonfly.discourse.group/t/is-it-possible-to-change-maxmemory-policy/313/1 "2025-09-03T15:39:11Z")

</div>

Hello!  
I see in the output INFO MEMORY:  
`maxmemory_policy:noeviction`

can i change this policy?

`127.0.0.1:6379> info server`  
`redis_version:7.4.0`  
`dragonfly_version:df-v1.28.1`

as far as I understand - no!?

---

<div class="post-metadata">

**Author:** ![joezhou\_df](https://yyz2.discourse-cdn.com/flex004/user_avatar/dragonfly.discourse.group/joezhou_df/32/82_2.png) [@joezhou\_df](https://dragonfly.discourse.group/u/joezhou_df)\
**Post date:** [September 3, 2025, 5:21pm UTC](https://dragonfly.discourse.group/t/is-it-possible-to-change-maxmemory-policy/313/2 "2025-09-03T17:21:19Z")

</div>

Hi @KleinenberG,

I don’t think Dragonfly allows changing the eviction policy on the fly while the server is running at the moment, but a server flag (and a restart of the server) can be used.

In the meantime, we don’t have the same eviction policies Redis has. We have only one `cache mode`, which is a sophisticated and efficient LRU + LFU combined algorithm.

- [Read more about Dragonfly’s cache mode](https://www.dragonflydb.io/blog/dragonfly-cache-design)
- [Configure Dragonfly with `--cache_mode=true`](https://www.dragonflydb.io/docs/managing-dragonfly/flags#--cache_mode)

After the change, the below is what I get. And Dragonfly would evict keys when the used memory is getting close to `maxmemory`.

```bash
dragonfly$> INFO MEMORY
# ...
cache_mode:cache
maxmemory_policy:eviction
# ...

```

---

<div class="post-metadata">

**Author:** ![KleinenberG](https://yyz2.discourse-cdn.com/flex004/user_avatar/dragonfly.discourse.group/kleinenberg/32/125_2.png) [@KleinenberG](https://dragonfly.discourse.group/u/KleinenberG)\
**Post date:** [September 4, 2025, 6:52am UTC](https://dragonfly.discourse.group/t/is-it-possible-to-change-maxmemory-policy/313/3 "2025-09-04T06:52:20Z")

</div>

Thank you very much for your answer!  
It works!
