mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-10-14 02:07:53 +08:00
The platform admin could not see what plugins cost: how much memory a
plugin's processes take on each node, or whether an idle one is stopped.
The host measures the resident memory of each plugin's process group,
which holds its children and, on Linux, the network sandbox's relay: from
/proc on Linux, from one ps run elsewhere (not on Windows). One sample of
all plugins is reused for 10 seconds; a plugin that just started is
measured again after a second. The host reports it through a new
reconcile.UsageReporter, with whether the plugin is stopped while idle,
and each node publishes it with its status; a single node reads its own.
The admin list sums it up per plugin in a memory field (bytes over the
measured instances, and how many are idle), shown in a new memory column
("idle" when all instances are stopped, "-" for remote and kubernetes
plugins). The detail drawer shows each node's memory or an idle tag.
Checked against ps on the example RSS plugin: 11812864 bytes reported
for 11536 KB.