monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Process Resource Update


From: Martin Pala
Subject: Re: Process Resource Update
Date: Wed, 04 Aug 2004 00:42:35 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.1) Gecko/20040726 Debian/1.7.1-4

Christian Hopp wrote:
On Mon, 2 Aug 2004, Christian Hopp wrote:


On Sat, 31 Jul 2004, Martin Pala wrote:


--8<--
  pt = xcalloc(sizeof(ProcessTree_T), treesize);
  memset(pt, 0, sizeof(ProcessTree_T) * treesize);
--8<--

Gonna remove it... mmmhhh... I should spend even more time reading
man-pages. (:


Fixed... and I read the man page (:


2.) it seems that the process related stuff needs to be fixed on Darwin
and OpenBSD...

Because IMO it won't work with the code... and a *BSD guy has to look over
it.


Tnx for helping me out with that job, Rory!



Okay, this patch has to be applied to the most recent CVS.  But please ppl
whether no more changes to the affected files or I have to commit it
soon.

Sorry for the changes ;)


I have tried the patch on linux, it seems that the memory usage numbers differs from what the system says about the process. For exmple slapd process:

1.) System reports:
unicorn:~/cvs/monit-proc# ps -ef | grep slapd
root      7011     1  0 23:15 ?        00:00:00 /usr/sbin/slapd

unicorn:~/cvs/monit-proc# pstree 7011
slapd

unicorn:~/cvs/monit-proc# more /proc/7011/statm
3826 670 1369 108 0 3718 0
/*
Provides information about memory status in pages.  The columns are:
size       total program size
resident   resident set size
share      shared pages
trs        text (code)
drs        data/stack
lrs        library
dt         dirty pages
*/

unicorn:~# ps -o pid,vsize,sz,rss,dsiz,trs,pmem -p 7011
  PID   VSZ    SZ  RSS DSIZ  TRS %MEM
 7011 15304  3826 2680 14880 423  0.5


2.) Monit reports:
Parameter               Value
-----------------------------
Name                    slapd
Process id              7011
Process status          running
Pid file                /var/run/slapd.pid
...
Process uptime          39m
CPU usage               0.0%
Memory usage            1.8% [9828kB]
Children                0
Total memory usage (incl. children)     1.8% [9828kB]


It is possible that it is correct, i have not looked to the code what exactly means the result from monit.


And for those who are interested I have added an experimental method to
gather (but not yet monitor!) the used main memory and total CPU load.  It
is currently stored in...

      Run.total_mem_kbyte
      Run.total_mem_percent
      Run.total_cpu_percent

... so feel free to play around with it and tell me if it results make
sense.

The result of global cpu and memory load looks good :) Only the Run.total_mem_kbyte parameter seems to differ from what other system tools reports.

1.)
top reports:
top - 00:28:02 up  1:36,  1 user,  load average: 0.05, 0.10, 0.12
Tasks:   1 total,   0 running,   1 sleeping,   0 stopped,   0 zombie
Cpu(s):  5.6% us,  2.0% sy,  0.0% ni, 92.0% id,  0.0% wa,  0.0% hi,  0.3% si
Mem:    517268k total,   231368k used,   285900k free,    17228k buffers
Swap:  1052216k total,        0k used,  1052216k free,   114344k cached
 0      0 289036  15644 113960   0   0    0   16 1102 476  4  1 95  0

vmstat reports:
unicorn:~/cvs/monit-proc# vmstat 5
procs--memory----------------------swap-------io--system--cpu----
r  b   swpd   free   buff  cache   si   so    bi  bo  in  cs us sy id wa
0  0   0 285068  17812 114724    0    0     0   62 1082  338  1  1 98  0
0  0   0 285068  17820 114724    0    0     0   15 1102  388  1  1 98  0
0  0   0 285068  17820 114724    0    0     0    0 1207  586  4  2 94  0


3.) monit reports (debug output for global values added):
[CEST Aug  4 00:27:49]  Run.total_mem_kbyte = 183712
[CEST Aug  4 00:27:49]  Run.total_mem_percent= 35.5%
[CEST Aug  4 00:27:49]  Run.total_cpu_percent= 3.9%
-
[CEST Aug  4 00:27:55]  Run.total_mem_kbyte = 183712
[CEST Aug  4 00:27:55]  Run.total_mem_percent= 35.5%
[CEST Aug  4 00:27:55]  Run.total_cpu_percent= 5.8%
-
[CEST Aug  4 00:28:00]  Run.total_mem_kbyte = 183712
[CEST Aug  4 00:28:00]  Run.total_mem_percent= 35.5%
[CEST Aug  4 00:28:00]  Run.total_cpu_percent= 5.8%
-
[CEST Aug  4 00:28:05]  Run.total_mem_kbyte = 183496
[CEST Aug  4 00:28:05]  Run.total_mem_percent= 35.4%
[CEST Aug  4 00:28:05]  Run.total_cpu_percent= 7.6%




reply via email to

[Prev in Thread] Current Thread [Next in Thread]