コンシューマーグループの遅延を監視する
XINFOとXPENDINGでコンシューマーグループの状態を調査し、遅延を測定し、停止したコンシューマーを見つけ、ストリーム処理を正常に保ちます。
「コンシューマーグループの遅延を監視する」はCoddyKit上の無料Redis Caching & Messaging (Pub/Sub, Streams)レッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはRedis Caching & Messaging (Pub/Sub, Streams)学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Redis Caching & Messaging (Pub/Sub, Streams)コースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Why Monitor Lag?
In a healthy pipeline, consumers keep up with producers. When they fall behind, lag builds up: unread or unacknowledged entries pile in the stream. Monitoring lag lets you scale consumers before backlogs become outages.
Inspecting the Stream
XINFO STREAM gives a high-level view: length, last generated ID, and the number of consumer groups attached.
XINFO STREAM ordersInspecting Groups
XINFO GROUPS lists each group with its last-delivered-id, the count of pending entries, and (in recent Redis) a lag field showing how many entries the group has not yet read.
XINFO GROUPS ordersUnderstanding Lag
The lag value is the number of entries between the group's last-delivered-id and the stream's last entry. A steadily rising lag means producers outpace consumers.
Per-Consumer Detail
XINFO CONSUMERS drills into a single group, showing each consumer's pending count and idle time. A consumer with high idle time and many pending entries is likely stuck or dead.
XINFO CONSUMERS orders workersSummarizing Pending
XPENDING with just the key and group gives a summary: total pending, the lowest and highest pending IDs, and a per-consumer breakdown.
XPENDING orders workersDetailed Pending
The extended form lists individual pending entries with their idle time and delivery count, helping you find messages that keep failing.
XPENDING orders workers - + 10Spotting Poison Messages
A high delivery count on a pending entry signals a poison message: one that repeatedly fails and gets re-delivered. Route it to a dead-letter stream after a threshold.
XADD dead-letter * original_id 1716900000-0 reason "max retries"Alerting Thresholds
Turn metrics into alerts: warn when group lag exceeds a budget, or when any consumer's idle time crosses a limit while holding pending entries. Sample these via XINFO from a monitoring job.
Reacting to Lag
When lag climbs, add consumers to the group to parallelize processing, optimize the per-message work, or increase the trim cap so the buffer can absorb spikes. Each consumer in a group gets a disjoint slice of new entries.
A Monitoring Loop
A simple monitor periodically calls XINFO GROUPS, extracts lag and pending, and emits the values to your metrics system for dashboards and alerts.
while true; do redis-cli XINFO GROUPS orders; sleep 10; doneQuick Check
Test your understanding of lag monitoring.
Recap
You learned to monitor consumer group health using XINFO STREAM/GROUPS/CONSUMERS for lag and idle time, and XPENDING for pending detail and delivery counts. Use these signals to detect poison messages, set alert thresholds, and scale consumers before backlogs grow.
よくある質問
「コンシューマーグループの遅延を監視する」レッスンは無料ですか?
はい。「コンシューマーグループの遅延を監視する」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Redis Caching & Messaging (Pub/Sub, Streams)コースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Redis Caching & Messaging (Pub/Sub, Streams)コースには全4レッスンが含まれています。
「コンシューマーグループの遅延を監視する」で何を学びますか?
XINFOとXPENDINGでコンシューマーグループの状態を調査し、遅延を測定し、停止したコンシューマーを見つけ、ストリーム処理を正常に保ちます。 ブラウザで直接実行するハンズオンコードでRedis Caching & Messaging (Pub/Sub, Streams)を演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Redis Caching & Messaging (Pub/Sub, Streams)を始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのRedis Caching & Messaging (Pub/Sub, Streams)は初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「コンシューマーグループの遅延を監視する」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このRedis Caching & Messaging (Pub/Sub, Streams)レッスンでコードを書いて実行できますか?
はい。すべてのRedis Caching & Messaging (Pub/Sub, Streams)レッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- コンシューマーグループ入門
- コンシューマーグループロジックの実装
- 保留中のメッセージと障害への対処
- コンシューマーグループの遅延を監視する