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

Docker memory usage include cache, so is misleading #4375

Closed
julienmathevet opened this issue Jul 3, 2018 · 4 comments · Fixed by #4383
Closed

Docker memory usage include cache, so is misleading #4375

julienmathevet opened this issue Jul 3, 2018 · 4 comments · Fixed by #4383
Labels
area/docker bug unexpected problem or unintended behavior
Milestone

Comments

@julienmathevet
Copy link
Contributor

Docker plugin get memory usage which include cache. So after some hours, reported memory usage is totaly wrong.

I check code I see you compute memory usage without cache but is not reported to any metrics

mem := calculateMemUsageUnixNoCache(stat.MemoryStats)

Could we replace docker memory usage by a better memory usage or to add new metric like use_nocache ?

See also:

@danielnelson
Copy link
Contributor

Our code is based on the docker cli code, and we want the behavior be the same as upstream. I quickly looked at our code and it appears very similar to docker/cli#80 , Can you clarify which field is off?

mem := calculateMemUsageUnixNoCache(stat.MemoryStats)
memLimit := float64(stat.MemoryStats.Limit)
memfields["usage_percent"] = calculateMemPercentUnixNoCache(memLimit, mem)

@julienmathevet
Copy link
Contributor Author

In docker cli they replaced memory by mem usage without cache. In telegraf we compute only mem usage without cache for mem percent computing (see https://github.com/docker/cli/pull/80/files )

@julienmathevet
Copy link
Contributor Author

julienmathevet commented Jul 4, 2018

julienmathevet pushed a commit to julienmathevet/telegraf that referenced this issue Jul 5, 2018
julienmathevet pushed a commit to julienmathevet/telegraf that referenced this issue Jul 5, 2018
@julienmathevet
Copy link
Contributor Author

#4383

julienmathevet pushed a commit to julienmathevet/telegraf that referenced this issue Jul 6, 2018
@russorat russorat added this to the 1.7.2 milestone Jul 9, 2018
@danielnelson danielnelson added bug unexpected problem or unintended behavior and removed need more info labels Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docker bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants