kube-capacity | simple CLI that provides an overview of the resource | Command Line Interface library
kandi X-RAY | kube-capacity Summary
kandi X-RAY | kube-capacity Summary
A simple CLI that provides an overview of the resource requests, limits, and utilization in a Kubernetes cluster
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of kube-capacity
kube-capacity Key Features
kube-capacity Examples and Code Snippets
Community Discussions
Trending Discussions on kube-capacity
QUESTION
I've deployed metrics-server
in my K8s cluster (ver. 1.15)
I gather this is a standard way to perform simple mem utilization checks
I have a POD that contains multiple processes (wrapped with dumb-init
for process reaping purposes)
I want to know the exact current memory usage of my POD.
The output kube-capacity --util --pods
:
ANSWER
Answered 2020-Mar-25 at 09:43The ps
does not reflect the actual amount of memory used by the application but only the memory reserved for it. It can be very misleading if pages are shared by several processes or by using some dynamically linked libraries.
Understanding memory usage on Linux is a very good article describing how memory usage in Linux works and what ps is actually reporting.
Why
ps
is "wrong"Depending on how you look at it,
ps
is not reporting the real memory usage of processes. What it is really doing is showing how much real memory each process would take up if it were the only process running. Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported byps
are almost definitely wrong.
That is why ps
should not be used for some detailed data for memory consumption.
Alternative to ps
would be smem
.
It reports physical memory usage, taking shared memory pages into account. Then unshared memory is reported at the USS
(Unique Set Size). So you can use USS
when you want to ignore shared memory.
The unshared memory (USS
) plus process's proportion of shared memory is reported at the PSS
(Proportionial Set Size). Basically it add USS
along with a proportion of its shared memory divided by the number of processes sharing that memory.
On the other hand RSS
(Resident Set Size) is the amount of shared memory plus unshared memory used by each process. If any processes share memory, this will short report that over the amount of memory that is actually used.
Linux uses a resource management technique used in programming to efficiently implement a duplicate
or copy
operation. This is called copy-on-write
. So when you have parent and child process, they both will show the same RSS. With copy-on-write
linux ensures that both processes are really using the same memory.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install kube-capacity
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page