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

Improve docker plugin #436

Merged
merged 6 commits into from Nov 27, 2017
Merged

Improve docker plugin #436

merged 6 commits into from Nov 27, 2017

Conversation

astj
Copy link
Contributor

@astj astj commented Nov 2, 2017

Changed graph unit and scaled blkio.io_serviced to get IOPS properly.

@astj
Copy link
Contributor Author

astj commented Nov 2, 2017

I found Docker BlkIO IOPS actually indicates IO per Minute, so now I'm thinking how to handle this... 🤔

@astj astj changed the title [wip] Improve docker plugin Improve docker plugin Nov 24, 2017
@@ -37,7 +37,7 @@ var graphdef = map[string]mp.Graphs{
},
"docker.memory.#": {
Label: "Docker Memory",
Unit: "integer",
Unit: "bytes",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker.memory.#.{cache,rss} are taken from cgroup memory.stat

https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt

memory.stat file includes following statistics

# per-memory cgroup local status
cache		- # of bytes of page cache memory.
rss		- # of bytes of anonymous and swap cache memory (includes
		transparent hugepages).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, in many Linux distributions these stats are always zero (but in Docker for Mac non-zero).
ref: https://docs.docker.com/engine/admin/runmetrics/#memory-metrics-memorystat

Therefore, many distros chose to not enable it by default.

},
},
"docker.blkio.io_service_bytes.#": {
Label: "Docker BlkIO Bytes",
Unit: "integer",
Unit: "bytes",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt

- blkio.io_service_bytes
	- Number of bytes transferred to/from the disk by the group. These
	  are further divided by the type of operation - read or write, sync
	  or async. First two fields specify the major and minor number of the
	  device, third field specifies the operation type and the fourth field
	  specifies the number of bytes.

{Name: "write", Label: "Write", Diff: true, Stacked: true, Type: "uint64"},
{Name: "sync", Label: "Sync", Diff: true, Stacked: true, Type: "uint64"},
{Name: "async", Label: "Async", Diff: true, Stacked: true, Type: "uint64"},
{Name: "read", Label: "Read", Diff: true, Stacked: true, Type: "uint64", Scale: (1.0 / 60.0)},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt

- blkio.io_serviced
	- Number of IOs (bio) issued to the disk by the group. These
	  are further divided by the type of operation - read or write, sync
	  or async. First two fields specify the major and minor number of the
	  device, third field specifies the operation type and the fourth field
	  specifies the number of IOs.

@@ -55,17 +55,17 @@ var graphdef = map[string]mp.Graphs{
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt

- blkio.io_queued
	- Total number of requests queued up at any given instant for this
	  cgroup. This is further divided by the type of operation - read or
	  write, sync or async.

@itchyny
Copy link
Contributor

itchyny commented Nov 27, 2017

LGTM

@astj
Copy link
Contributor Author

astj commented Nov 27, 2017

Thanks.

@astj astj merged commit 9c4934e into master Nov 27, 2017
@astj astj deleted the more-improve-docker branch November 27, 2017 05:35
@astj astj mentioned this pull request Nov 28, 2017
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.

None yet

2 participants