Operating System - HP-UX
1833838 Members
2028 Online
110063 Solutions
New Discussion

sleep taking a lot of CPU

 
Quark
Valued Contributor

sleep taking a lot of CPU

Hi,

some time ago I installed OpenView Performance manager.
I am now looking at the graphs, in particular the 'cpu per process' graph.
I notice that the a process called 'sleep' sometimes takes up around 40% CPU.
I am guessing a script of apps is using the 'sleep' command.
I did a test with a 'sleep 60' and running top but sleep doesn't even show up in the top process list.
My question, can 'sleep' take so much CPU? There is also possibility that OVPM is wrong.

With kind regards,

KRis
5 REPLIES 5
RAC_1
Honored Contributor

Re: sleep taking a lot of CPU

There could be multiple possibilities.
Is OpenView doing cpu per process correctly??

did you check if the sleep process is sleep command and not the script called sleep.
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: sleep taking a lot of CPU

Can you post a small output of what you have ?
sleep is a state of a process waiting for resources and it can be a process by sleep command. It would be helpful to dig more if we have more infor from your side.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Quark
Valued Contributor

Re: sleep taking a lot of CPU

I don't know if Openview measures the process per CPU correctly. That's what I am trying to find out.
Also, I am only shown the name of the process, not the full path to the actual binary so I don't know if the sleep process I see is actually the UNIX default sleep process or some apps that is called sleep.

Kris
Muthukumar_5
Honored Contributor

Re: sleep taking a lot of CPU

sleep process will not take so much CPU surely. You can monitor this as,

# sleep 100&

# UNIX95= ps -ef -o sz= -o vsz= -o pid= -o args= -o ruser= -o pcpu | grep 'sleep'
16 68 14257 sleep 100 root 0.00

0.00 is the Percentage of CPU.

You can use ps -o pcpu to know the %CPU value for all process like,

# UNIX95= ps -ef -o sz,vsz,pid,args,ruser,pcpu

hth.

hth
Easy to suggest when don't know about the problem!
Tom Danzig
Honored Contributor

Re: sleep taking a lot of CPU

I think you are confusing the sleep procees with the sleep used in refering to overall process wait states. All processes are in some sort of a wait state all the time such as waiting on a socket, NFS, Stream, sleep, priority, I/O, etc.

If your overall systems processes are in a sleep state 40% of the time, there is no problem. The processes are just waiting for something to do.