runtime: batch ps -p in list -f instead of one call per entry - #274
Open
liayan wants to merge 1 commit into
Open
runtime: batch ps -p in list -f instead of one call per entry#274liayan wants to merge 1 commit into
liayan wants to merge 1 commit into
Conversation
runtime::list() calls "ps -p" separately for each rootfs entry, in alphabetical order, after the initial lsns scan that found the pids. Entries later in that order get checked further away in time from when lsns saw them running, so the staleness window NVIDIA#126/NVIDIA#220 already deal with is not fixed size, it grows with the number of running containers. Measured on an idle VM with N containers running: the gap between the lsns scan and each entry per-entry ps call went from ~46ms (1st entry) to ~286ms (40th entry), growing roughly linearly with N. Batching a single "ps -p" call right after the lsns scan and having the rest of the function work off that one snapshot keeps this at a flat ~40ms regardless of N. Ran the NVIDIA#126 repro (owner exits mid-list) 8x against this, still degrades gracefully to a name-only row like NVIDIA#220 intended, no regression there. Signed-off-by: Liang Yan <lyan@coreweave.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
runtime::list() calls "ps -p" separately for each rootfs entry, in alphabetical order, after the initial lsns scan that found the pids. Entries later in that order get checked further away in time from when lsns saw them running, so the staleness window #126/#220 already deal with is not fixed size, it grows with the number of running containers.
Measured on an idle VM with N containers running: the gap between the lsns scan and each entry per-entry ps call went from ~46ms (1st entry) to ~286ms (40th entry), growing roughly linearly with N. Batching a single "ps -p" call right after the lsns scan and having the rest of the function work off that one snapshot keeps this at a flat ~40ms regardless of N.
Ran the #126 repro (owner exits mid-list) 8x against this, still degrades gracefully to a name-only row like #220 intended, no regression there.