At a glance
When Redis is the session store, the number of session keys it holds should track the number of active shoppers on the storefront. This card puts the two side by side: session-key count from the Redis keyspace against active users from the linked ecommerce connector. They will never match exactly, but they should move together. Drift between them is the alarm. Too few session keys for the live user count means sessions are being lost (evicted, expired early, or never written), which logs shoppers out mid-journey. Too many means orphaned sessions are piling up and wasting memory. Either way the gap is a direct, Redis-distinctive read on whether your session layer is keeping pace with real demand.
Calculation
The card counts the session keys Redis is holding, scoped to the application’s session key prefix so it ignores caches, queues, and counters living in the same instance. On the other side it reads the active-user count from the linked ecommerce connector for the same moment. It then computes the drift, the signed gap between the two, and flags a sustained, material divergence. The signal is Redis-distinctive: because Redis often serves as the session backend behind a storefront, the session-key population is an independent, infrastructure-side confirmation of how many people are genuinely mid-journey. A healthy store keeps the two curves close. A persistent negative drift (fewer keys than users) is the revenue-relevant case because it means real shoppers are silently being logged out.Worked example
A fashion retailer on Adobe Commerce stores PHP sessions in Redis with a 30-minute TTL and asess: key prefix. The instance is shared with the page cache. On 18 Apr 26 a marketing push lifts traffic, the cache grows, and maxmemory is reached. The eviction policy is left at the default noeviction on the session DB but allkeys-lru on the cache DB, except the two share one instance. The platform team watches the drift.
Up to 10:30 the small negative drift is expected: a session key lives slightly longer than the user is active (the TTL has not lapsed yet), and some users open multiple tabs. At 11:00 the drift blows out. Active users nearly doubled but session keys barely grew, which means session writes are failing or session keys are being evicted under memory pressure from the shared cache. Shoppers who were logged in are suddenly anonymous: their carts empty, and any who were partway through checkout are bounced back to a guest state.
Sibling cards
Reconciling against the source
Where to look natively:On the application side: compare against the storefront’s own active-session or concurrent-user figure (Adobe Commerce admin, Shopify / BigCommerce analytics) for the same minute. Why our number may legitimately differ:redis-cli --scan --pattern 'sess:*' | wc -lto count session keys by prefix (useSCAN, neverKEYS, on a live instance, asKEYSblocks the server).redis-cli INFO keyspacefor thekeys=andexpires=totals on db0, which bound the session count from above.redis-cli DBSIZEfor the total key count if all sessions live in one DB.redis-cli TTL sess:<id>to confirm individual session lifetimes match the application’s configured timeout.
Known limitations / FAQs
A small negative drift is permanent on my store. Is that a problem? Usually not. A steady small gap, where active users slightly exceed session keys, is often just bot traffic or analytics counting visitors who never created a server-side session. The card cares about a sustained, material change in drift, not the constant background offset. Set the threshold in the Alert Rules tab to your normal baseline so routine noise does not alert. My drift is positive, more session keys than active users. Should I act? Mild positive drift is expected from TTL lag and multi-tab users. A large, growing positive drift means orphaned sessions are accumulating: keys whose users left but whose TTL is too long, or sessions written without a TTL at all. That wastes memory and can eventually contribute to eviction pressure. Check that every session key is written with an expiry and that the TTL matches your intended timeout. We do not use Redis for sessions. Does this card apply? No. This card is meaningful only when Redis is the session backend. If sessions live in the database or another store, the session-key count will be zero or unrelated to active users, and you should disable or ignore the card. The prefix scope it uses is configured per connector. Why scope to a key prefix instead of counting all keys? A production Redis usually mixes sessions with caches, queues, and counters. Counting all keys would drown the session signal. Scoping to the application’s session prefix (for examplesess: or PHPREDIS_SESSION:) isolates exactly the keys that should track active users.
Active users doubled but session keys did not move at all. What does that mean?
Session writes are failing outright, not just being evicted. Common causes: the connection pool is saturated so the app cannot write to Redis (check Connected Clients Saturation vs Traffic Burst), the instance is read-only after a failover, or a recent deploy changed the session prefix so new sessions are written under a name the card is not counting.
How do I confirm the count without hurting the live instance?
Use SCAN with a pattern, never KEYS. KEYS sess:* blocks the single-threaded server for the duration of the scan and can itself cause an incident on a busy instance. redis-cli --scan --pattern 'sess:*' iterates in safe batches.