Discussion:
[Monitorix-general] Process wrong memory stats
Bertrand Caplet
2014-11-19 17:35:41 UTC
Permalink
Hi,
I'm new to monitorix and I configured my monitorix.conf for the first
time. I activated the process graph I want to graph spamassassin (spamd)
process. When I write spamd in process conf I got strange memory stats
(Like 1'192'750 M) as seen on my attachement.

Could you guys help me ?

Thanks in advance,
Regards,
--
CHUNKZ.NET - casual fiddler and computer technician
Bertrand Caplet, Flers (FR)
Feel free to send encrypted/signed messages
Key ID: FF395BD9
GPG FP: DE10 73FD 17EB 5544 A491 B385 1EDA 35DC FF39 5BD9
Jordi Sanfeliu
2014-11-20 17:09:22 UTC
Permalink
Hi Bertrand,

Ouch!, this is really weird! :/

Let me explain. Monitorix gets (or at least it tries to) the total
amount of memory (and CPU, disk I/O, network I/O, threads, etc.) by
summarizing all the instances of the same process. In this case, it gets
the total memory value from the /proc/<PID>/stat' file.

I see two possibilities why you are getting such huge number:

1. You have a lot of instances of 'spamd' running in your system, and
Monitorix is just summarizing all their memory. This shouldn't be
possible because Monitorix gets the 'RSS' value instead of 'VSIZE' value.

2. You have a normal amount of instances of 'spamd' running in your
system but your Linux kernel is showing a different format in the
/proc/<PID>/stat' file, and Monitorix is getting a completely different
value which of course would lead into a really weird total number.

Please, check both possibilities and let me know.
Regards.
Post by Bertrand Caplet
Hi,
I'm new to monitorix and I configured my monitorix.conf for the first
time. I activated the process graph I want to graph spamassassin (spamd)
process. When I write spamd in process conf I got strange memory stats
(Like 1'192'750 M) as seen on my attachement.
Could you guys help me ?
Thanks in advance,
Regards,
--
Jordi Sanfeliu
FIBRANET Network Services Provider
http://www.fibranet.cat
Bertrand Caplet
2014-11-21 19:03:17 UTC
Permalink
Post by Jordi Sanfeliu
1. You have a lot of instances of 'spamd' running in your system, and
Monitorix is just summarizing all their memory. This shouldn't be
possible because Monitorix gets the 'RSS' value instead of 'VSIZE' value.
2. You have a normal amount of instances of 'spamd' running in your
system but your Linux kernel is showing a different format in the
/proc/<PID>/stat' file, and Monitorix is getting a completely different
value which of course would lead into a really weird total number.
Please, check both possibilities and let me know.
Regards.
Hi Jordi,

First thanks a lot for answering me.
I don't know why it does that, here the rss from /proc/<SPAMDPID>/stat
rss: 16082
and the one from nginx
is like this :
rss: 440

Is this alright ?

Another question, Can't I choose pid instead of name ?

Regards.
--
CHUNKZ.NET - casual fiddler and computer technician
Bertrand Caplet, Flers (FR)
Feel free to send encrypted/signed messages
Key ID: FF395BD9
GPG FP: DE10 73FD 17EB 5544 A491 B385 1EDA 35DC FF39 5BD9
Jordi Sanfeliu
2014-11-24 11:48:01 UTC
Permalink
Hi Bertrand,

The values 16082 and 440 seems OK to me, assuming you extracted the
right ones from their respective 'stat' files. To make sure, you could
pastebin here the complete 'stat' output for either 'spamd' and 'nginx'.

Regarding your final question, no, you can't choose PID. In fact, the
PID is a changing number and therefore your shouldn't rely on it.

Regards.
Post by Bertrand Caplet
Hi Jordi,
First thanks a lot for answering me.
I don't know why it does that, here the rss from /proc/<SPAMDPID>/stat
rss: 16082
and the one from nginx
rss: 440
Is this alright ?
Another question, Can't I choose pid instead of name ?
Regards.
--
Jordi Sanfeliu
FIBRANET Network Services Provider
http://www.fibranet.cat
Bertrand Caplet
2014-11-29 02:26:15 UTC
Permalink
Hey Jordi,
Post by Jordi Sanfeliu
The values 16082 and 440 seems OK to me, assuming you extracted the
right ones from their respective 'stat' files. To make sure, you could
pastebin here the complete 'stat' output for either 'spamd' and 'nginx'.
Here is the nginx stat:

pid: 1872
tcomm: (nginx)
state: S
ppid: 1
pgid: 1872
sid: 1872
tty_nr: 0
tty_pgrp: -1
flags: 4219200
min_flt: 140
cmin_flt: 0
maj_flt: 1
cmaj_flt: 0
utime: 0.000000
stime: 0.000000
cutime: 0.000000
cstime: 0.000000
priority: 20
nice: 0
num_threads: 1
it_real_value: 0.000000
start_time: 11.21 03:59 (688979.95s)
vsize: 88952832
rss: 457
rsslim: 9223372036854775807
start_code: 4194304
end_code: 4983276
start_stack: 140736417913184
esp: 140736417912120
eip: 140371517546262
pending: 0000000000000000
blocked: 0000000000000000
sigign: 0000000040001000
sigcatch: 0000000018016a07
wchan: 9223372036854775807
zero1: 0
zero2: 0
exit_signal: 0000000000000011
cpu: 0
rt_priority: 0
policy: 0

and here is the spamd stat:

pid: 28865
tcomm: (/usr/sbin/spamd)
state: S
ppid: 1
pgid: 28865
sid: 28865
tty_nr: 0
tty_pgrp: -1
flags: 4218944
min_flt: 13055
cmin_flt: 0
maj_flt: 0
cmaj_flt: 0
utime: 18.880000
stime: 2.710000
cutime: 0.000000
cstime: 0.000000
priority: 20
nice: 0
num_threads: 1
it_real_value: 0.000000
start_time: 11.28 06:46 (74217.14s)
vsize: 141729792
rss: 16097
rsslim: 9223372036854775807
start_code: 4194304
end_code: 4198724
start_stack: 140737406756336
esp: 140737406755592
eip: 140303687502019
pending: 0000000000000000
blocked: 0000000000000000
sigign: 0000000000001080
sigcatch: 0000000000016803
wchan: 9223372036854775807
zero1: 0
zero2: 0
exit_signal: 0000000000000011
cpu: 0
rt_priority: 0
policy: 0


Thanks a lot for helping me
Regards,
--
CHUNKZ.NET - casual fiddler and computer technician
Bertrand Caplet, Flers (FR)
Feel free to send encrypted/signed messages
Key ID: FF395BD9
GPG FP: DE10 73FD 17EB 5544 A491 B385 1EDA 35DC FF39 5BD9
Loading...