0

I am running 1000 docker containers sequentially. Each container instance runs a specific job. After the execution of the job, I kill the container to release resources and run another job within another instance and so on.

I would like to get the memory usage of each container. One value per container expressing the average memory usage.

How is it possible?

May be with prometheus, but I don't know how to use it

2 Answers 2

1

May be with prometheus, but I don't know how to use it

Prometheus and Cadvisor is one possibility, I gave a talk earlier in the week with an example doing this using Swarm. See http://www.slideshare.net/brianbrazil/prometheus-and-docker-docker-galway-november-2015

The metrics you're interested in will then be available with the cadvisor job label.

Sign up to request clarification or add additional context in comments.

2 Comments

However Prometheus is not efficient when you want for example gather the memory usage for a container running for 3 seconds
Prometheus is designed for metrics, things that are very brief like 3s are more events so you should look at an event logging system.
0

As per your statement, you are running multiple containers and want to scrape each containers memory usage. This can be done with prom query.

Container_memory_in_bytes will give you the complete information about how much memory is used by each container in real time.

Please find the link for setting up the complete monitoring infrastructure. enter link description here

With Promquery you can achieve this.

Hope this answered your question.

2 Comments

do you have an example to do that?
Yes. As you are familiar with docker, you can create complete monitoring infrastructure with it and as it as different exporters you can monitor with it. Please refer the blog which i have added in my answer. Please let me know if you have any issue.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.