Scenario
A typical e-commerce platform relies on Redis for caching, RabbitMQ for task queues, and Kafka for event streaming. One day, application latency spikes, order processing slows, and page loads time out. The infrastructure team notices Redis memory usage is near its limit, RabbitMQ queue depth is growing continuously, and Kafka consumers are hundreds of thousands of messages behind. Users start complaining, and business is impacted.
Symptoms
- Redis:
INFO memoryshowsused_memoryapproachingmaxmemory,INFO statsshows risingevicted_keysandexpired_keys, and slow log captures manyKEYSorSMEMBERScommands. - RabbitMQ: The management UI or
rabbitmqctl list_queuesshows a sharp increase in messages in queues, consumer count drops, andrabbitmq-diagnosticsreports memory and disk alarms. - Kafka:
kafka-consumer-groupsshows consumer group lag continuously growing, broker CPU and disk I/O usage rises, and partition replicas experience ISR shrinkage.
Diagnosis
- Identify hotspots: Use APM and monitoring tools (e.g., Prometheus/Grafana) to inspect request volume, error rates, and latency. Check for burst traffic or code defects.
- Redis diagnosis: Run
redis-cli --latencyandredis-cli --stat, and retrieve slow commands withSLOWLOG GET. Analyze for large keys, hotkeys, and whether the eviction policy is appropriate. - RabbitMQ diagnosis: Inspect connection count, channel count, and unacknowledged messages. Use
rabbitmqctl list_consumersto confirm consumers are online, andrabbitmqctl list_queues name messages consumersto see queue status. Common causes include insufficient consumer processing power or infinite loops. - Kafka diagnosis: Use
kafka-consumer-groups --describe --group <group>to check per-partition lag. Examine consumer config likemax.poll.recordsandsession.timeout.ms, along with broker disk and network metrics.
Commands
Redis
# Check memory and keyspace statistics
redis-cli INFO memory
redis-cli INFO keyspace
# View slow queries
redis-cli SLOWLOG GET 10
# Check large keys (using third-party tools like redis-rdb-tools)
redis-cli --bigkeys
# If using cluster, view cluster status
redis-cli CLUSTER INFO
RabbitMQ
# View queue status
rabbitmqctl list_queues name messages consumers
# View connections and channels
rabbitmqctl list_connections
rabbitmqctl list_channels
# Check memory and disk alarms
rabbitmq-diagnostics check_running
rabbitmq-diagnostics memory_breakdown
# Purge a queue (dangerous, use with caution)
rabbitmqctl purge_queue <queue_name>
Kafka
# View consumer group lag
kafka-consumer-groups --bootstrap-server localhost:9092 --describe --group my-consumer-group
# View topic details
kafka-topics --bootstrap-server localhost:9092 --describe --topic orders
# View broker logs for exceptions
journalctl -u kafka -n 200
Risk Controls
- Redis: Set a sensible
maxmemory-policy(e.g.,allkeys-lruorvolatile-lru), avoidKEYScommands, and useSCANinstead. Ensure spare memory when persistence (RDB/AOF) is enabled. - RabbitMQ: Configure queue length limits (
x-max-length) and message TTL, and use dead-letter queues for unconsumable messages. Enable lazy queues for high-throughput queues to reduce memory pressure. - Kafka: Tune
replica.lag.time.max.msandmin.insync.replicasto avoid ISR shrinkage. Optimize consumer-sidefetch.max.bytesandmax.poll.recordsto prevent processing timeouts. - General: Set up monitoring alerts for each middleware, such as Redis memory usage, RabbitMQ queue depth, and Kafka consumer lag. Conduct load tests and back up configurations before changes.
Rollback
If a configuration change worsens the situation, roll back immediately.
- Redis: Use
CONFIG GETandCONFIG SETfor temporary changes, but update the configuration file manually for persistence. If AOF is enabled, rolling back config does not require restart. If you accidentally useFLUSHALL, stop Redis immediately and restore the last backup (RDB). - RabbitMQ: If a policy causes issues, remove it with
rabbitmqctl clear_policy <name>. If a queue is purged, data cannot be recovered; you must rebuild from producers or backups. - Kafka: If broker config was modified, restart Kafka instances (do rolling restarts). For consumer groups, reset offsets with
--to-earliestor--to-latest, but be aware this may duplicate or lose messages. - Safety note: Ensure backups exist and notify team members before any destructive command.
Verification
After applying fixes, verify that the middleware has recovered.
- Redis:
INFO statsshowsevicted_keysstabilizing, and latency returns to normal. Confirm latency <1ms withredis-cli --latency. - RabbitMQ: Queue depth decreases, consumer count recovers, and
rabbitmq-diagnostics statusshows all nodes running. - Kafka: Consumer group lag drops to zero or near zero, and ISR is stable. Use
kafka-producer-perf-testandkafka-consumer-perf-testto verify throughput. - Business level: Core API response times drop, and order processing stops backing up.
When to Submit an OpsGlobal Ticket
If your team faces any of the following, it is time to call OpsGlobal:
- The same middleware issue recurs frequently without a clear root cause.
- Deep tuning or architectural changes are required (e.g., sharding, cluster migration).
- Production data loss or inconsistency occurs and needs rapid recovery.
- Your team lacks 24x7 support while issues happen during critical hours.
OpsGlobal's SRE experts can quickly pinpoint bottlenecks, provide production-grade hardening solutions, and respond according to SLA. Don't wait until failure spreads; submit a ticket early to ensure business continuity.
Use cases
Useful for teams handling NoSQL issues and needing a clear troubleshooting and delivery workflow.
Problem background
Learn how SREs troubleshoot and harden Redis, RabbitMQ, and Kafka in production, with real commands, rollback strategies, and risk controls.
Troubleshooting steps
Confirm impact and recent changes, collect logs, configuration and metrics, then apply fixes from low to high risk.
Command examples
Replace sample resource names with real values and store passwords, tokens and keys in environment variables.
Risks
Before production changes, confirm backups, access boundaries, change windows and rollback paths.
Rollback plan
Keep original configuration and release versions; roll back config, images or database changes if metrics degrade.
Deliverables
Root-cause notes, key commands, remediation steps, verification results and follow-up recommendations.
Need help with a similar technical issue?
If your servers, Kubernetes, Docker, CI/CD, databases or monitoring systems have similar issues, submit logs and config files for remote diagnosis.