---
title: "What are Redis Memory Eviction Policies and how do you choose the right one?"  
description: "What are Redis Memory Eviction Policies and how do you choose the right one?"  
author: "John Smith"  
published: 2026-09-17  
canonical: https://answers.mindstick.com/qa/117199/what-are-redis-memory-eviction-policies-and-how-do-you-choose-the-right-one  
category: "Redis"  
tags: ["Redis", "Caching", "Database Administration"]  
reading_time: 1 minute  

---

# What are Redis Memory Eviction Policies and how do you choose the right one?

When Redis reaches its maximum allocated memory limit defined by the `maxmemory` configuration setting, it invokes an eviction policy to determine which keys should be removed to make room for new write operations.

### Key Eviction Strategies

- **allkeys-lru**: Evicts the least recently used keys across all keys, regardless of TTL settings.
- **volatile-lru**: Evicts least recently used keys that have an explicit expiration time configured.
- **noeviction**: Returns write errors when memory capacity is reached (default policy).

You can configure the active **maxmemory-policy** dynamically using Redis CLI parameters:

```sql
-- Set maximum memory cap to 2 Gigabytes
CONFIG SET maxmemory 2gb

-- Change memory eviction policy to volatile-lru
CONFIG SET maxmemory-policy volatile-lru

-- Inspect current maxmemory-policy setting
CONFIG GET maxmemory-policy
```


---

Original Source: https://answers.mindstick.com/qa/117199/what-are-redis-memory-eviction-policies-and-how-do-you-choose-the-right-one

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
