----- Original Message ----
> From: Zhong Wang <[email protected]>
> To: [email protected]
> Sent: Tue, December 29, 2009 1:11:05 PM
> Subject: [Ganglia-general] Python module problem with large peak values
>
> Hi all,
>
> We have implemented a python module with ganglia to monitor vmstat
> context switches. But we encountered a strange problem that some very
> large peak values appears randomly. Normally, the context switches
> should be within the scope of 1e2 - 1e5, but we have meet 1e14 or 1e15
> values. This didn't happen too often but every 1 - 2 days. The large
> values mess up the whole monitor graph because we can't watch the normal
> values. Did anyone meet the same problem?
>
That smells like a counter wrapping around. As you are using "vmstat" the
problem is likely there. It is reading "/proc/stat" (on Linux) to get the ctxt
numbers. You could try to log the "vmstat" output until the peak happens to be
sure.
Alternatively, you could use "/proc/stat" directly and handle any wrapping
yourself. Of course, that is not portable to systems not based on "/proc".
Cheers
Martin
> We have tested our python code and thought there should not be an error.
> Python code is something like this below:
> ----
> def vm_cs(name):
> global num
> global sum
> lines = os.popen("vmstat 1 4|sed -n '4,$p'")
> for line in lines:
> line = line.split()
> num = num + 1
> sum += float(line[11])
> sum = sum/num
> num = 0
> return float(sum)
> ----
>
> --
> Zhong
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Ganglia-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ganglia-general
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general