0
0
Redisquery~20 mins

Why configuration matters in Redis - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is configuring maxmemory important in Redis?

Redis allows setting a maxmemory limit. What happens if you do not configure maxmemory in a Redis instance?

ARedis will automatically delete old keys to free memory without any configuration.
BRedis will use unlimited memory until the system runs out of RAM, possibly causing crashes.
CRedis refuses to start without a <code>maxmemory</code> setting.
DRedis will store data only on disk and not use RAM.
Attempts:
2 left
💡 Hint

Think about what happens when a program uses more memory than the system has.

query_result
intermediate
2:00remaining
What is the output of CONFIG GET maxmemory after setting it?

After running CONFIG SET maxmemory 1048576 in Redis, what will CONFIG GET maxmemory return?

Redis
CONFIG SET maxmemory 1048576
CONFIG GET maxmemory
A["maxmemory", "1mb"]
B["maxmemory", "0"]
CError: maxmemory is read-only
D["maxmemory", "1048576"]
Attempts:
2 left
💡 Hint

Remember Redis stores memory sizes in bytes internally.

📝 Syntax
advanced
2:00remaining
Which CONFIG SET command correctly sets maxmemory-policy to allkeys-lru?

Choose the correct Redis command to set the eviction policy to allkeys-lru.

ACONFIG SET maxmemory-policy allkeys-lru
BCONFIG SET maxmemory_policy allkeys-lru
CCONFIG SET maxmemory policy allkeys-lru
DCONFIG SET maxmemory-policy='allkeys-lru'
Attempts:
2 left
💡 Hint

Redis configuration keys use hyphens, not underscores or spaces.

optimization
advanced
2:00remaining
How does setting maxmemory-policy to volatile-lru affect Redis behavior?

If Redis is configured with maxmemory-policy volatile-lru, what happens when memory limit is reached?

ARedis evicts only keys with an expiration set, using least recently used order.
BRedis evicts any keys regardless of expiration, using least recently used order.
CRedis refuses to evict keys and returns errors on writes.
DRedis deletes keys randomly without considering expiration.
Attempts:
2 left
💡 Hint

Consider what 'volatile' means in Redis eviction policies.

🔧 Debug
expert
3:00remaining
Why does Redis reject CONFIG SET maxmemory 0 in some versions?

In some Redis versions, running CONFIG SET maxmemory 0 causes an error. Why?

ABecause 0 disables maxmemory, which is invalid in those versions.
BBecause 0 is interpreted as unlimited memory, which is not allowed.
CBecause maxmemory must be set to a positive integer or -1 to disable.
DBecause the command syntax requires quotes around 0.
Attempts:
2 left
💡 Hint

Check Redis documentation on valid maxmemory values.