Skip to content

The Heroku Redis Maxmemory Policy

New Course Coming Soon:

Get Really Good at Git

Heroku offers a great Redis addon, which provides 25MB of memory for free.

This amount of storage can be easily filled with just a few thousands items, depending on what you’re storing.

Heroku has a configuration option called maxmemory-policy that determines how the system will behave when the Redis database memory is filled.

By default this property is set to noeviction, which means Redis will raise an error when trying to store more data.

This is done so you realize what is happening, and once you find out that you can change this behavior, it’s time to determine how.

The various behaviors are provided by Redis itself, and they are:

It’s up to you to find the best case for your needs. Once you do have a candidate, you can apply the change using the Heroku CLI, for example:

heroku redis:maxmemory YOUR_REDIS_INSTANCE_NAME --policy volatile-lru
Are you intimidated by Git? Can’t figure out merge vs rebase? Are you afraid of screwing up something any time you have to do something in Git? Do you rely on ChatGPT or random people’s answer on StackOverflow to fix your problems? Your coworkers are tired of explaining Git to you all the time? Git is something we all need to use, but few of us really master it. I created this course to improve your Git (and GitHub) knowledge at a radical level. A course that helps you feel less frustrated with Git. Launching May 21, 2024. Join the waiting list!

Here is how can I help you: