Cluster Aggregate View — Technical Design Doc - WIP #474
Replies: 3 comments 1 reply
|
Thanks for sharing! couple of user experience things:
|
|
Let's include how you plan on getting these metrics in the design. |
|
Thanks for the proposal, I think this is a useful idea. Sharing some comments that may be helpful.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Cluster Aggregate View — Technical Design Doc - WIP
Addressing: #395
Consolidated cluster view merged into the Cluster Topology route
1. Overview
This document proposes a consolidated Cluster view for the Valkey Admin, merged into the existing Cluster Topology route. It adds aggregated, cluster-wide metrics (total memory against capacity, total throughput, cluster-wide hit ratio, and a count of flagged nodes) alongside a per-node breakdown table, so a user can go from "is anything wrong" to "which node, and why" in a single screen.
The reason for node based aggregation is because Valkey does not provide a dedicated command for retrieving cluster-wide metrics such as total memory/capacity, total throughput and so on. Therefore, these metrics must be collected from each node using INFO and aggregated to obtain the overall cluster-level values. The fan-out and the aggregation both happen on the server.
GlideClusterClient.info()collects INFO from every node in one call, and the server derives per-node utilization from it before pushing a single payload to the client. Utilization is computed there rather than in the browser because CPU load is a sampled rate — it requires holding the previous reading between polls, which a component cannot do across a route change.2. Motivation
Currently, clusters can only be assessed by opening individual nodes one at a time in the dashboard (
/dashboard) view. There is no way to see cluster-wide totals or compare nodes side by side without manually cross-referencing each node's page. This makes three common diagnostic tasks slow:A unified view collapses this from N node visits into one screen with searchable, filtered rows.
3. Goal
The goal of the cluster aggregate view is to:
4. Current State
The existing Cluster Topology route shows summary counts — Total Nodes, Primary Nodes, Replicas, Connected — and a searchable list of primary/replica pairs by name, host, and port. Each row shows a primary node with its memory usage, cpu usage and connection count, and links to its paired replica.
This view answers “what is the shape of my cluster” but not “which part of my cluster is under pressure.”
There is no aggregate throughput or hit-ratio number, no per-node utilization signal, and no way to compare nodes against each other without opening each one.
5. Proposed Design
The Cluster metrics are added to the top of the Cluster Topology route as a row of stat cards, with the existing node list replaced by an expanded table that carries the new per-node metrics. The primary/replica relationship from Topology is preserved as the row grouping; utilization data is layered on top of it rather than replacing it.
Metrics and the utilization badge are rendered on primary rows only; replica rows carry name, host, port and role. The view refreshes on a five-second poll (
CLUSTER_DATA_POLL_INTERVAL_MS), started when the route mounts and torn down when it unmounts.6. INFO Metrics Used
Every number on the aggregate view comes from one INFO call to each node, repeated every five seconds. Nothing else is queried.
INFO returns two kinds of number, and we treat them differently:
Because that subtraction needs the previous reading, running totals are converted once when the data is collected rather than in the browser, which would lose the previous reading whenever the user leaves the page.
6.1 Metrics used to calculate utilization
used_memorymaxmemoryis checked against, so the percentage matches what actually causes eviction.maxmemory0when no limit is set, which is how we know to fall back to the next row.total_system_memorymaxmemoryis0.used_cpu_sys_main_thread,used_cpu_user_main_threadused_cpu_sys,used_cpu_user6.2 Metrics shown as reported
server_nameused_memory_human1.05M).instantaneous_ops_per_seckeyspace_hits,keyspace_missesconnected_clientsCluster totals are sums, not averages of percentages. Hits and misses from every node are added together before the ratio is worked out, so a busy node counts for more than a quiet one. Cluster Memory adds up used bytes and limits separately.
7. UI Component Breakdown
7.1 Stat cards
instantaneous_ops_per_secacross all nodes, replicas included.7.2 Per-node row fields
Metric columns are populated on primary rows only. Replica rows show name, host, port and role, and leave the remaining cells empty.
8. Utilization Classification
Each primary is classified Low, Normal, or High. The badge is the primary scanning aid in the table — it lets a user with a cluster of 50 nodes find the handful that matter without reading every row. Low means the node is lightly loaded, not that it needs attention — in a cache, low utilization is neutral, so it is rendered in muted gray, Normal in green, and only High in red.
The classification takes two inputs, memory utilization and CPU utilization, each judged against its own band: a cache is expected to sit near its memory limit, so memory tolerates higher percentages than CPU, where sustained load near one core means the command loop is saturating. The worse of the two results becomes the node's level, so a node at 30% memory and 90% CPU is High.
"of host RAM — no maxmemory set."Where a node reports neither, no percentage is produced.used_cpu_sys_main_threadandused_cpu_user_main_thread. Command execution is single threaded, so these are bounded by one core and the percentage reads directly against the 85% CPU band. It falls back to the process-wideused_cpu_sysandused_cpu_useron servers that do not report the main-thread counters; those totals include I/O and background threads, so the reading can exceed 100% and will flag High more readily than the main-thread path.9. Edge Cases
All reactions