# Question about Eviction

**URL:** <https://dragonfly.discourse.group/t/question-about-eviction/119>\
**Category:** Dragonfly Technical\
**Created:** [October 26, 2023, 6:07am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119 "2023-10-26T06:07:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [October 26, 2023, 6:07am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/1 "2023-10-26T06:07:12Z")

</div>

Hello, does Dragonfly support different eviction policies like Redis ?

> **[Key eviction](https://redis.io/docs/latest/develop/reference/eviction/)**
>
> Overview of Redis key eviction policies (LRU, LFU, etc.)

 ![image.png](https://canada1.discourse-cdn.com/flex004/uploads/dragonfly/original/1X/dbd1f20cb9ad60cc616accd17656077a95ccf1cf.png)  
 ![image.png](https://canada1.discourse-cdn.com/flex004/uploads/dragonfly/original/1X/bd8ee09466404e64aec49b07bc8037583e8ed666.png)

---

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [October 26, 2023, 6:09am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/2 "2023-10-26T06:09:15Z")

</div>

The context is around this

The VM that Dragonfly is running is hitting around 94% usage so I am deciding whether to increase the memory or should adjust the eviction to keep the memory usage lower

---

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [October 26, 2023, 6:18am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/3 "2023-10-26T06:18:46Z")

</div>

Took these info out of the instance  
[info\_all.txt](https://dragonfly.discourse.group/uploads/short-url/bckaTNdVyZyZGP6toDW23qfLC2I.txt) (3.93 KB)  
[objhist.txt](https://dragonfly.discourse.group/uploads/short-url/cp7Fk5cZhllMv6x1X6vTRyk9199.txt) (7.1 KB)

---

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [October 26, 2023, 6:19am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/4 "2023-10-26T06:19:43Z")

</div>

Ooo, maybe it’s related to this

[https://discord.com/channels/981533931486724126/981533931960676364/1156122910575038496](https://discord.com/channels/981533931486724126/981533931960676364/1156122910575038496)

---

<div class="post-metadata">

**Author:** ![inclusive-numbat](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@inclusive-numbat](https://dragonfly.discourse.group/u/inclusive-numbat)\
**Post date:** [October 26, 2023, 6:54am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/5 "2023-10-26T06:54:21Z")

</div>

the good news some eviction happens:

```auto
evicted_keys:6657536

```

but yeah, we need to improve on that front. We are working on improving our eviction strategy (cc @realistic-ferret )

---

<div class="post-metadata">

**Author:** ![inclusive-numbat](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@inclusive-numbat](https://dragonfly.discourse.group/u/inclusive-numbat)\
**Post date:** [October 26, 2023, 6:54am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/6 "2023-10-26T06:54:35Z")

</div>

thank you for providing all the relevant info

---

<div class="post-metadata">

**Author:** ![inclusive-numbat](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@inclusive-numbat](https://dragonfly.discourse.group/u/inclusive-numbat)\
**Post date:** [October 26, 2023, 6:55am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/7 "2023-10-26T06:55:38Z")

</div>

I suggest that instead of provisioning more memory you set a lower “maxmemory” limit as a workaround for now

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [October 27, 2023, 4:05pm UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/8 "2023-10-27T16:05:25Z")

</div>

hi @resourceful-antelope the PR has been posted. If you build DF by yourself, I would be happy to collaborate with you to do the test. Otherwise, I will let you know when it gets merged and we can use our weekly built docker image.

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [October 27, 2023, 4:05pm UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/9 "2023-10-27T16:05:27Z")

</div>

[https://github.com/dragonflydb/dragonfly/pull/2084](https://github.com/dragonflydb/dragonfly/pull/2084)

---

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [October 29, 2023, 5:08am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/10 "2023-10-29T05:08:37Z")

</div>

Hey @realistic-ferret thanks for working on this. I wanna wait for PR to be merged to the `main` and build a binary from there 😄

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [October 29, 2023, 6:07am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/11 "2023-10-29T06:07:06Z")

</div>

sounds good, i will let you know

---

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [November 2, 2023, 6:34am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/12 "2023-11-02T06:34:25Z")

</div>

I see the PR has been merged 🙌

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [November 2, 2023, 6:37am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/13 "2023-11-02T06:37:23Z")

</div>

yes, would you like to give it a try? 😃

---

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [November 2, 2023, 6:38am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/14 "2023-11-02T06:38:30Z")

</div>

Yep! I will build the binary on top of the latest branch and give it a shot !

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [November 2, 2023, 6:39am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/15 "2023-11-02T06:39:24Z")

</div>

let me know if you have any question, thanks!

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [November 2, 2023, 6:40am UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/16 "2023-11-02T06:40:52Z")

</div>

we also plan to do a 1.12 release this week, so it will be officially available

---

<div class="post-metadata">

**Author:** ![resourceful-antelope](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@resourceful-antelope](https://dragonfly.discourse.group/u/resourceful-antelope)\
**Post date:** [November 3, 2023, 1:53pm UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/17 "2023-11-03T13:53:44Z")

</div>

@realistic-ferret Seems to be doing as expected!

 ![image.png](https://canada1.discourse-cdn.com/flex004/uploads/dragonfly/original/1X/55e23d438379c07e791e752d40df040e728106fd.png)

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [November 3, 2023, 1:54pm UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/18 "2023-11-03T13:54:36Z")

</div>

wonderful!

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [November 3, 2023, 1:54pm UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/19 "2023-11-03T13:54:59Z")

</div>

thanks for the fast test!

---

<div class="post-metadata">

**Author:** ![realistic-ferret](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@realistic-ferret](https://dragonfly.discourse.group/u/realistic-ferret)\
**Post date:** [November 3, 2023, 1:55pm UTC](https://dragonfly.discourse.group/t/question-about-eviction/119/20 "2023-11-03T13:55:15Z")

</div>

i wondered how fast do you inject data?

[Next page](https://dragonfly.discourse.group/t/question-about-eviction/119.md?page=2)
