Skip to content

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