Closed joschi99 closed 1 year ago
I use the statm proc file. If the value is wrong, do you have a suggestion for a file ?
A approach could be to use /proc/pid/status using VmRSS value:
cat /proc/1632/status
Name: mysqld
Umask: 0006
State: S (sleeping)
Tgid: 1632
Ngid: 0
Pid: 1632
PPid: 1
TracerPid: 0
Uid: 997 997 997 997
Gid: 995 995 995 995
FDSize: 8192
Groups: 995
VmPeak: 3088656 kB
VmSize: 3023720 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 865564 kB
VmRSS: 865500 kB
RssAnon: 850772 kB
RssFile: 14728 kB
RssShmem: 0 kB
VmData: 2923568 kB
VmStk: 132 kB
VmExe: 19548 kB
VmLib: 10428 kB
VmPTE: 2172 kB
VmSwap: 0 kB
Threads: 47
SigQ: 0/31174
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000087007
SigIgn: 0000000000001000
SigCgt: 00000001800066e9
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000000000004000
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp: 0
Speculation_Store_Bypass: vulnerable
Cpus_allowed: f
Cpus_allowed_list: 0-3
Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 525944
nonvoluntary_ctxt_switches: 98
SNMP value:
OK: Number of current processes running: 1 - Total memory usage: 845.21 MB - Average memory usage: 845.21 MB | 'nbproc'=1;;;0; 'mem_total'=886272000B;;;0; 'mem_avg'=886272000.00B;;;0;
Process '1632' [memory: 845.21 MB] [status: runnable] [name: mysqld]
Another aproach is to use still /proc/pid/statm utilizzando il valore "resident":
cat /proc/1632/statm
755930 216375 3682 4887 0 730925 0
resident pagesize = utilization 216.375 4.096 = 886.272.000 -> 845,21MB
As you can see both methods are considered "inacurate", but the actual values are completly wrong
https://man7.org/linux/man-pages/man5/proc.5.html VmRSS Resident set size. Note that the value here is the sum of RssAnon, RssFile, and RssShmem. This value is inaccurate; see /proc/[pid]/statm above.
Hi @garnier-quentin, did you need some other information?
are there some news? the values reported via SSH are completly wrong actually (not usable).
latest plugins - monitoring the process memory usage returns wrong values:
SNMP returns correct values:
Top command:![image](https://user-images.githubusercontent.com/6400595/222356402-aaed2fd5-64b9-4a31-96b3-ab3507af4402.png)
Summary