You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update the system metrics when a worker holds more than one actor #1664
Parent issue for the effect of multi-actor worker support (#1266) on the system metrics of Substrate.
State
#1266 phase 1 landed. A worker now reports an actor capacity and an allocated total, and the scheduler reads both. The scheduler is capacity-aware. The metrics are not. The registry still describes a fleet of one actor for each worker.
The problem
ateapi derives the state of a worker from "does this worker hold any actor". With a capacity of 20 actors, a worker with 1 actor and a worker with 20 actors give the same answer. Thus:
ate.workerpool.workers no longer measures the saturation of a pool. It measures only how many workers hold at least one actor.
The sum of that metric over the assigned state is the only proxy today for the number of actors in operation. The proxy becomes wrong.
ate.scheduler.eligible_workers counts workers and not capacity. Ten workers with one free slot and one worker with ten free slots give a different count and the same schedulable capacity.
This parent changes the existing instruments only. It adds no instrument.
I think this leaves the main gap open. Pool utilization needs slot counts, not worker counts (similar to db.client.connection.count{state} + db.client.connection.max in semconv). #433 doesn't cover slots, so can we track this in a new child issue?
Also, the scheduler picks a random worker among the free ones. With more than one slot per worker, partial looks like 100% busy at low load, and at_capacity stays ~0 and then jumps. Neither really works as a good HPA signal, so I'd say the demo should move to slot counts once we have them.
#1854 fixed the worker state, but worker counts still can't tell us how full a pool is.
This parent changes the existing instruments only. It adds no instrument.
Based on the autoscaling discussion, I think we need new instruments here. Thinking about allocated and capacity per pool, one pair each for actors, CPU and memory (similarly to k8s.node.allocatable.* in semconv, one instrument per resource since the units differ). ateapi already has these in the worker cache, so should be cheap enough.
These track what the scheduler reserves, which is what decides no_capacity, so I'd say this suffice as HPA input. With one HPA metric per resource, the HPA scales on whichever runs out first, so we don't need to assume actors are all the same size. Once these land, we can move the demo HPA to them and revisit partial/at_capacity as per #1801.
Open to add new instrumentation, I originally create the parent issue with a small scope just to update existing system metrics for new multi-actor support. I will update the ticket.
Activity
ate.worker.state#1799JeffLuoo commentedon Sep 22, 2026
Krisztian F (@krisztianfekete) I created several sub-issue for the multi-worker support. #1266 Please review, and feel free to add more sub-issue.
krisztianfekete commentedon Sep 24, 2026
I think this leaves the main gap open. Pool utilization needs slot counts, not worker counts (similar to
db.client.connection.count{state}+db.client.connection.maxin semconv). #433 doesn't cover slots, so can we track this in a new child issue?Also, the scheduler picks a random worker among the free ones. With more than one slot per worker,
partiallooks like 100% busy at low load, andat_capacitystays ~0 and then jumps. Neither really works as a good HPA signal, so I'd say the demo should move to slot counts once we have them.JeffLuoo commentedon Sep 24, 2026
Created #1864
(ateapi): report worker occupancy by actor slots in ate.worker.state (a…
BenTheElder commentedon Sep 25, 2026
Regarding HPA signals: https://cloud-native.slack.com/archives/C0B6M3E2J3D/p1790200752576789
krisztianfekete commentedon Sep 25, 2026
#1854 fixed the worker state, but worker counts still can't tell us how full a pool is.
Based on the autoscaling discussion, I think we need new instruments here. Thinking about allocated and capacity per pool, one pair each for actors, CPU and memory (similarly to
k8s.node.allocatable.*in semconv, one instrument per resource since the units differ). ateapi already has these in the worker cache, so should be cheap enough.These track what the scheduler reserves, which is what decides
no_capacity, so I'd say this suffice as HPA input. With one HPA metric per resource, the HPA scales on whichever runs out first, so we don't need to assume actors are all the same size. Once these land, we can move the demo HPA to them and revisitpartial/at_capacityas per #1801.JeffLuoo commentedon Sep 25, 2026
Open to add new instrumentation, I originally create the parent issue with a small scope just to update existing system metrics for new multi-actor support. I will update the ticket.