feat: peer occupancy panels for the out-peers experiment

opened MINUS closed per direction, plotted against the caps. Occupancy
is the measurement that matters and cumulative opens actively mislead:
inbound churns constantly (170 opened, 156 closed) while outbound is
deliberately maintained (36 opened, 27 closed), so a high inbound open
count says nothing about whether its cap is full. Reading the ratio of
cumulative opens is how issue #1 came to recommend the wrong knob.

Measured now: outbound 9 held against a cap of 8 -- saturated -- while
inbound sits at 14 of 32 and the node has discovered 300 peers. So
--out-peers binds and --in-peers does not, the reverse of what #1 said.

No exporter change needed; both series are already scraped from the
node. Adds the discovered-peers count and rounds-per-minute alongside,
since those are the other two the experiment compares.
This commit is contained in:
Rob Thijssen
2026-09-01 06:05:01 +03:00
parent 867a71f514
commit d784db8e3a
+230 -1
View File
@@ -9,7 +9,7 @@
],
"timezone": "browser",
"schemaVersion": 39,
"version": 5,
"version": 6,
"refresh": "30s",
"time": {
"from": "now-6h",
@@ -2221,6 +2221,235 @@
"values": false
}
}
},
{
"type": "row",
"title": "Peer occupancy (experiment: lair/quantus#1)",
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 98
},
"panels": []
},
{
"type": "timeseries",
"title": "Connections held vs cap, by direction",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"h": 9,
"w": 14,
"x": 0,
"y": 99
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(substrate_sub_libp2p_connections_opened_total{job=\"quantus-node\",direction=\"out\"}) - sum(substrate_sub_libp2p_connections_closed_total{job=\"quantus-node\",direction=\"out\"})",
"legendFormat": "outbound held",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(substrate_sub_libp2p_connections_opened_total{job=\"quantus-node\",direction=\"in\"}) - sum(substrate_sub_libp2p_connections_closed_total{job=\"quantus-node\",direction=\"in\"})",
"legendFormat": "inbound held",
"range": true,
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "8",
"legendFormat": "out cap (default)",
"range": true,
"refId": "C"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "32",
"legendFormat": "in cap (default)",
"range": true,
"refId": "D"
}
],
"description": "opened MINUS closed, which is occupancy. Cumulative opens measure churn and mislead: inbound churns constantly while outbound is deliberately maintained, so a high inbound open count says nothing about whether its cap is full. Outbound sitting on its cap while ~300 peers are discovered is the case for raising --out-peers (issue #1).",
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 2,
"fillOpacity": 6,
"showPoints": "never"
},
"color": {
"mode": "palette-classic"
}
},
"overrides": [
{
"matcher": {
"id": "byRegexp",
"options": ".*cap.*"
},
"properties": [
{
"id": "custom.lineStyle",
"value": {
"dash": [
8,
8
],
"fill": "dash"
}
},
{
"id": "custom.fillOpacity",
"value": 0
}
]
}
]
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "stat",
"title": "Peers discovered",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"h": 4,
"w": 10,
"x": 14,
"y": 99
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "substrate_sub_libp2p_peerset_num_discovered{job=\"quantus-node\"}",
"legendFormat": "discovered",
"range": true,
"refId": "A"
}
],
"description": "Peers the node knows about. The gap between this and outbound-held is the headroom --out-peers is refusing to use.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "text",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
}
}
},
{
"type": "timeseries",
"title": "Mining rounds per minute",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"h": 5,
"w": 10,
"x": 14,
"y": 103
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(rate(substrate_proposer_block_constructed_count{job=\"quantus-node\"}[5m])) * 60",
"legendFormat": "rounds/min",
"range": true,
"refId": "A"
}
],
"description": "Stale-tip proxy for the experiment: each new tip triggers a fresh proposal, so this should track the network block rate. Below it means tips are arriving late.",
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 2,
"fillOpacity": 8,
"showPoints": "never"
},
"color": {
"mode": "palette-classic"
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
}
]
}