redis icon indicating copy to clipboard operation
redis copied to clipboard

[QUESTION] Does redis get my server run out of memory

Open nhokmoon opened this issue 1 year ago • 1 comments

My server has 8 GB of RAM, and I use Redis for caching. If my API, which uses Redis for caching, handles about 100 requests per second, will my server run out of RAM given that Redis caches data in memory?

nhokmoon avatar Oct 07 '24 06:10 nhokmoon

There isn't enough data to answer that. This is rhetorical - you don't need to answer, but:

  • how many unique keys are there at any time, after accounting for the lifetime of your data?
  • how large is each key+payload pair?

Multiplying those two numbers, plus some slack, should give you an idea of whether the size is sufficient. After that: eviction policy: https://redis.io/docs/latest/develop/reference/eviction/

mgravell avatar Oct 07 '24 22:10 mgravell