forked from saicaca/fuwari
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: Docker cAdvisor | ||
published: 2024-12-01 | ||
description: Overseeing resource consumption of all Docker containers on a VM | ||
image: cover.png | ||
tags: [Technology] | ||
category: English | ||
draft: false | ||
--- | ||
|
||
[cAdvisor] (Container Advisor) provides Docker container users an understanding of | ||
the resource usage and performance characteristics of their running containers. It is a running daemon that collects, | ||
aggregates, processes, and exports information about running containers. Specifically, for each container it keeps | ||
resource isolation parameters, historical resource usage, histograms of complete historical resource usage and network | ||
statistics. This data is exported by container and machine-wide. | ||
|
||
<!--truncate--> | ||
|
||
Although [cAdvisor] has some prelimilary (useful though) UI. It also offers | ||
|
||
1. [RESTful API to query container stats](https://github.com/google/cadvisor/blob/master/docs/api.md) | ||
2. [Export capability to common data storage, such as Elasticsearch](https://github.com/google/cadvisor/blob/master/docs/storage/README.md) | ||
|
||
To pull the image and run it: | ||
|
||
```bash | ||
sudo docker run \ | ||
--volume=/:/rootfs:ro \ | ||
--volume=/var/run/docker.sock:/var/run/docker.sock:rw \ | ||
--volume=/sys:/sys:ro \ | ||
--volume=/var/lib/docker/:/var/lib/docker:ro \ | ||
--volume=/dev/disk/:/dev/disk:ro \ | ||
--publish=8080:8080 \ | ||
--detach=true \ | ||
--name=cadvisor \ | ||
--privileged \ | ||
--device=/dev/kmsg \ | ||
gcr.io/cadvisor/cadvisor:v0.36.0 | ||
``` | ||
|
||
![cAdvisor Screenshot 1](cadvisor-1.png) | ||
![cAdvisor Screenshot 2](cadvisor-2.png) | ||
|
||
### [docker-container-stats](https://github.com/virtualzone/docker-container-stats) | ||
|
||
[cAdvisor](https://github.com/google/cadvisor) is good for customizing container monitoring, but it's heavy. A | ||
quick-and-lightweight option would be [docker-container-stats](https://github.com/virtualzone/docker-container-stats) | ||
|
||
![docker-container-stats Screenshot](docker-container-stats.png) | ||
|
||
[cAdvisor]: https://github.com/google/cadvisor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters