improve performance of reading sandbox stats (oom, peak memory)#133
Open
syphar wants to merge 1 commit into
Open
improve performance of reading sandbox stats (oom, peak memory)#133syphar wants to merge 1 commit into
syphar wants to merge 1 commit into
Conversation
| /// Most of the time: v2 | ||
| /// on old systems like the docs.rs builder: v1 | ||
| #[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
| pub(super) enum CgroupVersion { |
Member
There was a problem hiding this comment.
Instead of implementing all that, why not using crates with this feature like sysinfo?
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.
after each command in the build we see (and need) this:

most
exec catcalls as <100 ms, but I regularly see calls between 2 and 10 seconds. Which is quite a waste, when we see that we currently do 4 calls after each container command (two for oom, two for memory peak).First optimization was that we remember which cgroup version we have, so then we can save one call in the later checks.
Then I discovered that we also can get the same information directly in special files from the host. So I added this. From what I see, the locations likely speficic to the used setup / engine, so I left the
exec catapproach in. I checked that the "fast" way would be used by docs.rs.I don't like the added complexity, but the performance impact will likely be noticeable.
While we're on it I extracted the bigger cgroup stats code into a new module, container lifetime stuff stays in
ContainerGenerally: I think most randomly show things are i/o bound, and increasing the bandwidth / iops will hopefully help.