Fixes #10824. Adjusted docker stats memory output#32777
Conversation
|
Please sign your commits following these rules: $ git clone -b "10824-dockerstats-misleading-mem" [email protected]:Sergeant007/docker.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354520728
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
f1e18e6 to
31fe27a
Compare
31fe27a to
4c56d4a
Compare
|
@ripcurld0, @vdemeester |
There was a problem hiding this comment.
why the float64(usedNoCache)? (usedNoCache already is a float64)
There was a problem hiding this comment.
you can pass memLimit here instead of v.MemoryStats.Limit, and change the signature of calculateMemPercentUnixNoCache to;
func calculateMemPercentUnixNoCache(limit float64, usedNoCache float64) float64There was a problem hiding this comment.
Perhaps use GoDoc convention here;
// calculateMemUsageUnixNoCache calculates the amount of memory excluding page cache
or something like that 😄
Signed-off-by: Sergey Tryuber <[email protected]>
4c56d4a to
706fc05
Compare
|
Hi @thaJeztah |
|
Hi @stevvooe, |
|
Please resolve by yourself |
|
Also, now this needs to be moved to https://github.com/docker/cli |
|
Hi @AkihiroSuda
This does not "needs to be moved", this is throwing away current and making a brand new pull request and large chunk of "paper work", just because you, guys, are not friendly to 3rd party contributions (or slow, or whatever else - please, find and fire). Unfortunately I'll have time to do the adjustment only in next several weeks. |
|
CL is now Docker, Inc.'s product and not under the scope of Moby project. (#32694) I carried this PR to docker/cli#80
Even I'm one of 3rd party contributors, not an employee of Docker, Inc. 😕 |
|
@Sergeant007 please try to keep your comments respectful? We realise there's extra work needed during the transition to a separate Moby project and Docker product, which we're right in the middle of. We do try to review and merge PR's as quickly as possible, but rebases and merge-conflicts cannot be avoided in a fast moving repository, but are happy to help where needed. |
[Carry moby/moby#32777] Adjusted docker stats memory output
|
merged docker/cli#80, closing |
[Carry moby/moby#32777] Adjusted docker stats memory output Upstream-commit: 85c2330dfa4d3845d4cd5f4502709335bce8ee0e Component: cli
Signed-off-by: Sergey Tryuber [email protected]
- What I did
"docker stats" CLI command now outputs memory usage without page cache. Fixes #10824.
- How I did it
Followed to the solution suggested by @crosbymichael in #10824 - "just subtract the cache from the usage value before displaying it to the user".
- How to verify it
#10824 contains the debug steps to prove that "docker stats" used to include page cache in its output. This PR corrects the behavior.
Experiment (Docker version 17.06.0-dev, build 1eec7b5). The steps are done inside development container, you would need to open several terminals to the development container.
Step 0. build the binaries and then start docker daemon listening on tcp
Step 1. start a container with bash
Step 2. open a new terminal window and ensure that memory consumption in stats is low
Step 3. Let is work for several hours to ensure that memory doesn't grow significanly (or believe me ans skip this step)
Step 4. Do some heavy file operations that grow page cache (in docker container console from Step 1)
Step 5. Check docker stats again to see that there is no page cache included in the output
Step 6. Conclusion
With this PR docker stats outputs reasonable amount of used memory (no page cache included)
- Description for the changelog
"docker stats" command outputs memory usage with no page cache memory included.
- A picture of a cute animal (not mandatory but encouraged)
My cat Tom.
