# LRU Accuracy

> What is the maxmemory-samples setting, why does Redis approximate LRU and LFU instead of implementing them exactly, and how should you tune it?

Canonical: https://www.internhack.in/learn/interview/redis-caching/redis-max-memory-samples
Last updated: 2026-11-28

Difficulty: Advanced

## Question

What is the maxmemory-samples setting, why does Redis approximate LRU and LFU instead of implementing them exactly, and how should you tune it?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

maxmemory-samples, Approximated LRU, LFU, Eviction pool, maxmemory-policy

Previous: [Popping from Sorted Sets](https://www.internhack.in/learn/interview/redis-caching/redis-zpopmin-max) · [All of Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)

## More Redis & Caching questions

- [Caching Strategies](https://www.internhack.in/learn/interview/redis-caching/redis-caching-strategies)
- [Eviction Policies](https://www.internhack.in/learn/interview/redis-caching/redis-eviction-policies)
- [Persistence: RDB vs. AOF](https://www.internhack.in/learn/interview/redis-caching/redis-persistence-rdb-aof)
- [Transactions & Atomicity](https://www.internhack.in/learn/interview/redis-caching/redis-transactions-multi)
- [Pub/Sub Messaging](https://www.internhack.in/learn/interview/redis-caching/redis-pub-sub)
- [Sentinel vs. Cluster](https://www.internhack.in/learn/interview/redis-caching/redis-sentinel-vs-cluster)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)
