Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Container performance improvements #47

Merged
merged 4 commits into from
Aug 17, 2017
Merged

Conversation

conorbranagan
Copy link
Contributor

Improves the performance of the container checks significantly:

(from a test w/ 70 running containers, 10s cache)

benchmark                    old ns/op     new ns/op     delta
BenchmarkAllContainers-2     78556378      3733144       -95.25%

benchmark                    old allocs     new allocs     delta
BenchmarkAllContainers-2     38768          6330           -83.67%

benchmark                    old bytes     new bytes     delta
BenchmarkAllContainers-2     7538615       1143256       -84.83%

Changes included:

  • Removing stats we don't use from CPU and Memory to cut down on file reads. Caching MemLimit and CPULimit after the first run. (dca5876)
  • Adding caching to container list metadata so we only get the latest containers every 10s. (0505470)
  • General alloc optimizations in file reading, etc. (e44b0de)
  • Parsing the docker health from the container list API. This allows us to remove the CollectContainerHealth option and have it on by default, because there is no perf impact. (596537b)

We will end up caching the CPU and MemLimits so having them separate
makes this easier
The cache duration can be set via the config for more up-to-date list of
containers if needed.
Since we already have this data there's no need to make this an option
anymore as it doesn't add any additional load.
Copy link
Contributor

@shang-wang shang-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great improvement too

@conorbranagan conorbranagan merged commit 1839f34 into master Aug 17, 2017
@conorbranagan conorbranagan deleted the conor/docker-perf branch August 17, 2017 18:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants