Bird
Raised Fist0
Redisquery~20 mins

Monitoring with INFO command in Redis - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Redis INFO Command Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of INFO command for memory stats
What is the output of the following Redis command snippet when querying memory stats?

INFO memory

Assume Redis server is running normally with some keys stored.
Redis
INFO memory
AShows a JSON object with memory usage details
BReturns only the total number of keys stored in Redis
CContains lines like 'used_memory:', 'used_memory_rss:', and 'mem_fragmentation_ratio:' with numeric values
DOutputs an error saying 'unknown command INFO memory'
Attempts:
2 left
💡 Hint
INFO command sections are divided by categories like memory, server, clients, etc.
🧠 Conceptual
intermediate
1:30remaining
Understanding INFO command sections
Which of the following is NOT a valid section you can query with the Redis INFO command?
Aserver
Bnetwork
Cpersistence
Dclients
Attempts:
2 left
💡 Hint
Check Redis documentation for INFO command sections.
❓ Troubleshoot
advanced
2:00remaining
Diagnosing missing INFO command output
You run INFO on your Redis server but get an empty response. What is the most likely cause?
Redis
INFO
AYou connected to the wrong port where no Redis server is running
BRedis server is running in protected mode and INFO command is disabled
CThe Redis server is running but has no data stored yet
DThe INFO command requires authentication and you did not authenticate
Attempts:
2 left
💡 Hint
Check your connection and server status.
✅ Best Practice
advanced
1:30remaining
Using INFO command for monitoring in production
Which practice is best when using the Redis INFO command for monitoring in a production environment?
AAvoid using INFO command and rely only on Redis logs
BRun INFO command frequently (every second) to get real-time stats
CRun INFO command only once after server restart
DRun INFO command periodically (e.g., every minute) and parse output for key metrics
Attempts:
2 left
💡 Hint
Consider performance impact and usefulness of data.
🔀 Workflow
expert
2:30remaining
Interpreting INFO command output for memory troubleshooting
Given this snippet of Redis INFO memory output:
used_memory:10485760
used_memory_rss:20971520
mem_fragmentation_ratio:2.0

What does this indicate about Redis memory usage?
Redis
INFO memory
ARedis is using twice as much memory from the OS than it actually needs, indicating possible memory fragmentation
BRedis memory usage is normal and fragmentation ratio below 1.0
CRedis is using less memory than allocated, so no fragmentation is present
DRedis has a memory leak causing used_memory to be zero
Attempts:
2 left
💡 Hint
Compare used_memory and used_memory_rss values and fragmentation ratio.

Practice

(1/5)
1. What does the Redis INFO command primarily provide?
easy
A. A snapshot of the Redis server status and statistics
B. A list of all keys stored in Redis
C. The configuration file contents
D. A backup of the Redis database

Solution

  1. Step 1: Understand the purpose of INFO command

    The INFO command is designed to give a snapshot of the Redis server's current status and statistics.
  2. Step 2: Compare with other options

    Listing keys, showing config files, or backups are done by other commands, not INFO.
  3. Final Answer:

    A snapshot of the Redis server status and statistics -> Option A
  4. Quick Check:

    INFO = Server status snapshot [OK]
Hint: INFO shows server stats, not keys or configs [OK]
Common Mistakes:
  • Confusing INFO with commands like KEYS or CONFIG
  • Thinking INFO returns data backups
  • Assuming INFO lists all stored keys
2. Which of the following is the correct syntax to get only the memory section info from Redis?
easy
A. INFO --section=memory
B. INFO -memory
C. GET INFO memory
D. INFO memory

Solution

  1. Step 1: Recall Redis INFO command syntax

    The correct syntax to get a specific section is INFO section_name, for example, INFO memory.
  2. Step 2: Eliminate incorrect options

    Options with dashes or GET keyword are invalid Redis command syntax.
  3. Final Answer:

    INFO memory -> Option D
  4. Quick Check:

    INFO section_name = INFO memory [OK]
Hint: Use INFO followed by section name without dashes [OK]
Common Mistakes:
  • Adding dashes before section name
  • Using GET keyword with INFO
  • Using double dashes or equal signs
3. Given the Redis INFO output snippet:
used_memory:1024000
connected_clients:5
uptime_in_seconds:3600

What does connected_clients indicate?
medium
A. Number of clients currently connected to Redis
B. Number of keys stored in Redis
C. Total memory used by Redis in bytes
D. Redis server uptime in seconds

Solution

  1. Step 1: Identify the meaning of connected_clients

    The connected_clients field shows how many clients are currently connected to the Redis server.
  2. Step 2: Differentiate from other fields

    used_memory is memory usage, uptime_in_seconds is server uptime, and keys count is not shown here.
  3. Final Answer:

    Number of clients currently connected to Redis -> Option A
  4. Quick Check:

    connected_clients = active connections [OK]
Hint: connected_clients means active users connected now [OK]
Common Mistakes:
  • Confusing connected_clients with key count
  • Mixing memory usage with client count
  • Assuming uptime is client count
4. You run INFO client but get an error. What is the most likely cause?
medium
A. Redis server is down
B. You need to run INFO without any arguments
C. The section name 'client' is misspelled or unsupported
D. You must use GET instead of INFO

Solution

  1. Step 1: Check valid section names for INFO

    Redis INFO supports specific section names like 'clients' (plural), not 'client' (singular).
  2. Step 2: Understand error cause

    Using an invalid or misspelled section name causes an error, not server down or wrong command usage.
  3. Final Answer:

    The section name 'client' is misspelled or unsupported -> Option C
  4. Quick Check:

    INFO section names must be exact [OK]
Hint: Use exact section names; 'clients' not 'client' [OK]
Common Mistakes:
  • Using singular instead of plural section names
  • Assuming server is down without checking
  • Trying GET command instead of INFO
5. You want to monitor Redis memory usage and client connections continuously. Which approach using the INFO command is best?
hard
A. Run INFO once and save output to a file
B. Run INFO memory and INFO clients repeatedly in a script with a delay
C. Use INFO all once and check manually later
D. Run CONFIG GET memory and CONFIG GET clients repeatedly

Solution

  1. Step 1: Identify continuous monitoring needs

    To monitor memory and clients continuously, you need repeated INFO queries with a delay to track changes over time.
  2. Step 2: Evaluate options

    Running INFO memory and INFO clients repeatedly in a script fits this need. Running once or using CONFIG GET won't provide continuous updates.
  3. Final Answer:

    Run INFO memory and INFO clients repeatedly in a script with a delay -> Option B
  4. Quick Check:

    Repeated INFO calls = continuous monitoring [OK]
Hint: Use repeated INFO calls in script for live monitoring [OK]
Common Mistakes:
  • Running INFO only once for monitoring
  • Using CONFIG GET which is for config, not stats
  • Running INFO all once expecting continuous data
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard