Challenge - 5 Problems
Maxmemory Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate1:30remaining
What is the output of the command to check maxmemory?
You run the Redis command
CONFIG GET maxmemory. What is the expected output format?Redis
CONFIG GET maxmemory
Attempts:
2 left
💡 Hint
Remember Redis returns configuration as an array with key and value.
✗ Incorrect
The CONFIG GET command returns an array with the parameter name and its value as strings.
🧠 Conceptual
intermediate1:30remaining
What happens if maxmemory is set to 0 in Redis?
In Redis, if you set maxmemory to 0, what does it mean for memory usage?
Attempts:
2 left
💡 Hint
Think about what zero means as a limit.
✗ Incorrect
Setting maxmemory to 0 disables memory limits, so Redis can use all available memory.
📝 Syntax
advanced2:00remaining
Which command correctly sets maxmemory to 100 megabytes?
Choose the correct Redis command to set maxmemory to 100MB.
Attempts:
2 left
💡 Hint
Redis expects maxmemory in bytes, not with units.
✗ Incorrect
Redis requires maxmemory value in bytes, so 100MB = 100 * 1024 * 1024 = 104857600 bytes.
❓ optimization
advanced2:00remaining
How to configure Redis to evict least recently used keys when maxmemory is reached?
You want Redis to remove least recently used keys automatically when memory limit is reached. Which command sets this behavior?
Attempts:
2 left
💡 Hint
Look for a policy that evicts any key based on usage.
✗ Incorrect
The allkeys-lru policy evicts the least recently used keys from all keys when memory is full.
🔧 Debug
expert2:30remaining
Why does Redis not evict keys despite maxmemory being set and policy configured?
You set maxmemory to 50MB and maxmemory-policy to allkeys-lru, but Redis never evicts keys and memory usage grows beyond 50MB. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check if maxmemory is properly set and non-zero.
✗ Incorrect
If maxmemory is zero or not set properly, eviction policies are ignored and Redis won't evict keys.