1825766 Members
2125 Online
109687 Solutions
New Discussion

Glance vs ps

 
Dale Holt
New Member

Glance vs ps

I'm trying to monitor a TeMIP implementation running on multiple machines in an HP-UX Itanium Superdome. A daily report runs that uses "UNIX95=1 ps -C vt_tl1_am -o vsz,pcpu,stime,comm" to report on memory and cpu usage.

The values reported by "ps" vary greatly from what Glance (gpm gui) reports. Top reports values of memory that are similar to gpm, but a value of CPU similar to ps.

For example, on front end #18:
Tue Oct 14 22:47:14 dholt@omztfb8:~/

$ UNIX95=1 ps -C "vt_tl1_am" -o vsz,pcpu,stime,comm

VSZ %CPU STIME COMMAND
971912 24.45 15:38:56 vt_tl1_am

Glance (from the gpm gui):

vt_tl1_am Res Mem = 1.07gb, Virtual Memory = 3.14gb, CPU % = 1.4

These numbers are completely different!!!

What’s going on? Which one is correct? How do I get ps and gpm to agree?

Thanks,
Dale Holt

10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: Glance vs ps

Hi Dale:

> How do I get ps and gpm to agree?

You don't and you won't.

Glance is kernel savy. The 'ps' output doesn't atake into account shared memory or shared libraries whereas 'glance' counts these along with the stack, data and text size.

Moreover, the units reported by 'ps' are memory page size units. Glance reports in 1KB units.

Regards!

...JRF...
Dale Holt
New Member

Re: Glance vs ps

Thanks! That's very interesting. What about CPU? Does the vt_tl1_am use 1/4 of the machine per ps and top, or hardly any per glance?
Dale Holt
New Member

Re: Glance vs ps

However, the man page for ps states that for "vsz" the size is in kilobytes (1024 byte units) of the core image of the process, not pages. Curiously, the "sz" output is stated to be in pages, including text, data, and stack space.

Dale
James R. Ferguson
Acclaimed Contributor

Re: Glance vs ps

Hi Dale:

> However, the man page for ps states that for "vsz" the size is in kilobytes...the "sz" output is stated to be in pages...

Yes, you are correct. Sorry for my inversion.

Regards!

...JRF...
Dale Holt
New Member

Re: Glance vs ps

James,

Is there something similar for percentage of CPU usage? Top and ps show 24.45% but Glance shows only 1.4%.
Thanks,
Dale Holt
Dennis Handly
Acclaimed Contributor

Re: Glance vs ps

>Is there something similar for percentage of CPU usage?

For top, it is the percentage of one CPU. Perhaps for glance is a percentage of all CPUs?
Patrick Wallek
Honored Contributor

Re: Glance vs ps

Yes, glance does take into account all CPUs. However, the total CPU percentage that glance reports is <# of CPUs> x 100. So if you have 8 CPUs in your system then you have a possiblity of 800% utilization.

Attached is a screen shot of the character mode Glance from on of my servers with 6 CPUs.

Dennis Handly
Acclaimed Contributor

Re: Glance vs ps

Perhaps my statement was confusing. The percentage in top adds up to N * 100%. From what Patrick says about glance, we can't explain the difference in: 24.45% but Glance shows only 1.4%.
Perhaps these values were for different time periods? Or one was averaged differently?
Dale Holt
New Member

Re: Glance vs ps

To clear things up, GlancePlus is updating every 15 seconds, top is updating every 5 seconds, and I was entering the ps command about every two seconds.

Also, this is for a single CPU system. I haven't even tackled the multiple cpu systems yet.

It is odd that "top" reports 87.0% IDLE while the top five processes are using:
vt_tl1_am 18.11%
memory_ia64 17.01%
mcc_notif 5.46%
cmi_ses 1.12%
vxfsd 0.60%
-------
42.52%
And "ps" reports the name of the second highest cpu user as "".

Thanks,
Dale
Dennis Handly
Acclaimed Contributor

Re: Glance vs ps

>It is odd that "top" reports 87.0% IDLE while the top five processes are using: 42.52%

I wasn't aware that top was that bad.

>And "ps" reports the name of the second highest CPU user as "".

ps(1) is broken. zombie process take no CPU time. (Unless it just died and ps(1) is still averaging it.)