Skip to content

Commit 6f573e5

Browse files
authored
Update README.md
1 parent 4a29711 commit 6f573e5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# collectd-libpod-stats
22
Collectd plugin for gathering resource usage statistics from containers created with the [libpod library](https://github.com/containers/libpod).
33

4-
## Current functionality
5-
This plugin is being developed with the new [go-collectd](https://github.com/collectd/go-collectd) library which has not yet released version 1. As a result, the functionality of this project is bound by the ever changing abilities of the library. This means, many features that would be expected from a plugin cannot yet be implemented until the library makes it possible to do so.
4+
## Functionality
5+
This plugin is being developed with the new [go-collectd](https://github.com/collectd/go-collectd) library which has not yet released version 1. As a result, the functionality of this project is bound by the ever changing abilities of the library. Many features that would be expected from a plugin cannot yet be implemented until the library makes it possible to do so.
66

77
As of now, this plugin reports the following for each container on a node:
88

@@ -14,6 +14,13 @@ memory usage | bytes
1414

1515
There is no way to configure these options.
1616

17+
## Notes on memory usage calculations
18+
Calculating memory usage on linux systems is hairy and differs based on projects. This plugin replicates the memory calculation that the podman tool uses, that is, the value of `memory.usage_in_bytes` in the case of cgroups v1 or `memory.current` for cgroups v2. This value includes both RSS and CACHE memory values and thus is different to what the `free` tool reports as used memory by reading `/proc/meminfo`.
19+
20+
Kubernetes calulates the memory usage as `memory.usage_in_bytes - total_inactive_file` [(source)](https://github.com/kubernetes/kubernetes/blob/dde6e8e7465468c32642659cb708a5cc922add64/test/e2e/node/node_problem_detector.go#L242). Kubernetes uses this value to make [eviction decisions](https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#eviction-signals) and thus this value is important. However, k8s provides its own means of monitoring pod memory and should be used instead of this plugin.
21+
22+
Ultimately, this plugin uses the stated values because the linux cgroup oom_killer uses this value to destroy processes that exceed the hard limit.
23+
1724
## Build from source
1825

1926
Collectd library files must be made available to the golang compiler to build this plugin. Clone the [collectd project](https://github.com/collectd/collectd).

0 commit comments

Comments
 (0)