Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7765
  • Last Modified:

What is WCPU in top command?

On HP-UX, when I run the top command, there is a column for the WCPU (weighted CPU).  Can somebody tell me what this is?  Thanks.
0
mromeo
Asked:
mromeo
  • 2
  • 2
2 Solutions
 
PhreonxCommented:
Hello,
let me start off by mentioning the exact definition from the man page for top:

     "WCPU, when displayed, is the weighted cpu percentage."

Now a bit of explanation. %wcpu or weighted cpu percentage as I understand it, is an exponentially decaying, average percentage measured over the last few minutes, of the CPU time that was dedicated to a particular process. It has no real world value and it's value is totally controlled by the CPU scheduler. As you would expect, processes running for a short period of time the %wcpu should be very close to the actual %cpu.

Hope that helped ;)
0
 
mromeoAuthor Commented:
so, if the WCPU gets quite large (approx 80-90%), but the CPU % stays at about 50%, what is that indicating?
0
 
mromeoAuthor Commented:

This is what is happening when I try to compile some code w/ gcc.
0
 
PhreonxCommented:
I'd suspect that 80-90% of the CPU time is dedicated to swapping processes in and out of the CPU scheduler whereas 50% of the CPU is used for actual process execution by the CPU.
0
 
JJSmithCommented:

%CPU give the utilization of the last sample period.

%WCPU looks at the same process over a longer period.

In summary;

A process of short duration (one top sample period) should show almost identical %WCPU and %CPU.

A process of longer duration (more than 1 top sample period) would start to show a widening 'gap' between %WCPU and %CPU.

If a longer process was maxing the CPU in the last sample period, then expect %CPU to be bigger than %WCPU.

If a longer process had been maxing CPU for a while but in the last sample period it had lightened up - then expect %CPU to be lower than %WCPU.

Hope that helps
Cheers
JJ
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now