Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use one thread per container #28

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jeanpralo
Copy link

At the moment the class ContainerStats is using one thread per container.

When we create the threads we wait for the first docker stats api call to return, so the more container we have the longer it takes to start all the thread, also this becomes inefficient as if you have 100+ containers te docker daemon starts to timeout as it can't handle the load generated by all those threads.

That's why I decided to change it to use a certain number of workers ( 5 by default) which you can configure with the RateLimit key in the config.

This is probably not an ideal fix but at least we are getting the data in a more reliable way without generating too much load on the docker daemon.

Ideally we want docker to create one endpoint to get the stats of all running container as described here moby/moby#22052

@lebauce

@dustinblackman
Copy link

@lebauce This looks good to me, can we get it merged in, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants