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
The logic of the existing code of schedulerStatsFromProcs is to provide
a cumulative stats for all the processes inside a container. Once the
process is dead, its stat entry is no longer updated, but still used in
totals calculation. This creates two problems:
- pidsMetricsCache map is ever growing -- in case of many short-lived
processes in containers this can impact kubelet memory usage a lot;
- in case a new process with the same PID appears (as a result of PID
reuse), the stats from the old one are overwritten, resulting in
wrong totals (e.g. they can be less than previous, which should not
ever be the case).
To kill these two birds with one stone, let's accumulate stats from dead
processes in pidsMetricsSaved, and remove them from the pidsMetricsCache.
Signed-off-by: Kir Kolyshkin <[email protected]>
0 commit comments