GNU Linux sleeping processes in top command

hi all

sleeping processes in the following output , are they doing anything , but consuming lot of sources, should I need to kill them , how to know , , what they are doing

and the output says out of 260 processes only 9 are running , and 251 are sleeping , what does the sleeping means, can we terminate them,

please suggest me,

top - 02:44:13 up 36 days, 16:37,  1 user,  load average: 8.57, 8.41, 8.08
Tasks: 260 total,   9 running, 251 sleeping,   0 stopped,   0 zombie
Cpu(s): 98.6%us,  1.3%sy,  0.0%ni,  0.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:     31983M total,    31533M used,      450M free,     1673M buffers
Swap:    32671M total,      111M used,    32560M free,    26532M cached

  PID USER      PR  NI  VIRT  RES  SHR S   %CPU %MEM    TIME+  COMMAND
29220 oraSLV    20   0 8990m 4.4g 4.4g R     53 14.2 793:38.88 oracle
13666 oraSLV    20   0 8984m 1.1g 1.1g R     45  3.6  16:44.64 oracle
29228 oraSLV    20   0 8988m 4.4g 4.4g R     44 14.1 756:33.95 oracle
29250 oraSLV    20   0 8997m 4.4g 4.4g R     44 14.1 718:29.60 oracle
30245 oraSLV    20   0 8998m 4.4g 4.4g R     43 14.2 789:12.81 oracle
29222 oraSLV    20   0 8987m 4.4g 4.4g R     42 14.2 740:11.18 oracle
29234 oraSLV    20   0 8990m 4.4g 4.4g R     42 14.2 708:55.32 oracle
29248 oraSLV    20   0 8983m 4.4g 4.4g R     39 14.2 799:41.92 oracle
20113 oraSLV    20   0 8982m 1.3g 1.3g S      6  4.1  32:00.02 oracle
29188 SLVadm    20   0 6587m 1.4g 1.3g S      3  4.3  21:29.63 SLV_00_DIA_W9
28351 root      20   0  108m  11m 4140 S      2  0.0   0:00.05 python
30243 SLVadm    20   0 6593m 1.4g 1.3g S      2  4.4  20:44.20 SLV_00_DIA_W8
29181 SLVadm    20   0 6574m 1.4g 1.3g S      1  4.4  20:40.80 SLV_00_DIA_W2
28346 root      20   0  105m  10m 8140 S      1  0.0   0:00.03 zypper
25646 oraSLV    -2   0 8974m  16m  14m S      1  0.1  19:56.46 oracle
25700 root      20   0 14780 5068 1228 S      1  0.0   0:00.47 bash
29180 SLVadm    20   0 6582m 1.4g 1.3g S      1  4.5  22:05.64 SLV_00_DIA_W1
 2039 root      20   0 73788 3848 3292 S      0  0.0  33:56.40 vmtoolsd
 3657 root      20   0  9120  552  432 S      0  0.0   4:55.67 irqbalance
29179 SLVadm    20   0 6578m 1.4g 1.3g S      0  4.5  22:56.82 SLV_00_DIA_W0
29182 SLVadm    20   0 6583m 1.4g 1.3g S      0  4.5  21:12.59 SLV_00_DIA_W3
29184 SLVadm    20   0 6575m 1.3g 1.3g S      0  4.3  21:20.59 SLV_00_DIA_W5
29230 oraSLV    20   0 8997m 4.4g 4.4g S      0 14.0 667:10.44 oracle
    1 root      20   0 10540  736  704 S      0  0.0   0:33.88 init
    2 root      20   0     0    0    0 S      0  0.0   0:00.66 kthreadd
    3 root      20   0     0    0    0 S      0  0.0   0:54.38 ksoftirqd/0
    6 root      RT   0     0    0    0 S      0  0.0   0:06.93 migration/0
    7 root      RT   0     0    0    0 S      0  0.0   0:14.85 watchdog/0
    8 root      RT   0     0    0    0 S      0  0.0   0:10.00 migration/1
   10 root      20   0     0    0    0 S      0  0.0   0:22.66 ksoftirqd/1
   12 root      RT   0     0    0    0 S      0  0.0   0:15.34 watchdog/1
   13 root      RT   0     0    0    0 S      0  0.0   0:07.64 migration/2

You cannot arbitrarily kill sleeping processes. A sleeping process may be waiting on something -- input/output, a child process to return, etc.

Regards,
Alister

thank you Alister for the reply

my concern is , why the sleeping process is consuming resources ,

I want to free up the resources, also a total of 251 processes are sleeping.

how can we check , what exactly the processes is doing and is the process is doing really something worthy

Tasks: 260 total,   9 running, 251 sleeping 
PID USER      PR  NI  VIRT  RES  SHR S   %CPU %MEM    TIME+  COMMAND
20113 oraSLV    20   0 8982m 1.3g 1.3g S      6  4.1  32:00.02 oracle
29188 SLVadm    20   0 6587m 1.4g 1.3g S      3  4.3  21:29.63 SLV_00_DIA_W9
28351 root      20   0  108m  11m 4140 S      2  0.0   0:00.05 python
30243 SLVadm    20   0 6593m 1.4g 1.3g S      2  4.4  20:44.20 SLV_00_DIA_W8
29181 SLVadm    20   0 6574m 1.4g 1.3g S      1  4.4  20:40.80 SLV_00_DIA_W2
28346 root      20   0  105m  10m 8140 S      1  0.0   0:00.03 zypper
25646 oraSLV    -2   0 8974m  16m  14m S      1  0.1  19:56.46 oracle
25700 root      20   0 14780 5068 1228 S      1  0.0   0:00.47 bash
29180 SLVadm    20   0 6582m 1.4g 1.3g S      1  4.5  22:05.64 SLV_00_DIA_W1
 2039 root      20   0 73788 3848 3292 S      0  0.0  33:56.40 vmtoolsd
 3657 root      20   0  9120  552  432 S      0  0.0   4:55.67 irqbalance
29179 SLVadm    20   0 6578m 1.4g 1.3g S      0  4.5  22:56.82 SLV_00_DIA_W0
29182 SLVadm    20   0 6583m 1.4g 1.3g S      0  4.5  21:12.59 SLV_00_DIA_W3
29184 SLVadm    20   0 6575m 1.3g 1.3g S      0  4.3  21:20.59 SLV_00_DIA_W5
29230 oraSLV    20   0 8997m 4.4g 4.4g S      0 14.0 667:10.44 oracle

It might help to understand what a "sleeping" process is, so here it goes:

Suppose a process starts: it gets loaded into memory, so some memory has to be allocated to it. It also gets some processor time, otherwise it would lurk just there, unable to run. Now it starts and probably it will need some additional memory to hold runtime data, it might need other OS resources, like files to be opened, network connections to be established, etc., etc..

All these requests involve the OS, which may or may not be able to fulfill these immediately. If it is, the process gets what it requests, but if not it will be put to sleep until the OS can provide. That it is put to sleep does not mean it has nothing to do or that it could be stopped. This is just a way for the OS to do something else until it can provide everything necessary to run the process.

Another possiblity is that the process waits for a certain event: suppose the process services a certain network event: it will listen to the network and until a certain signal comes it has nothing to do - therefore it is going to sleep. When the signal comes, it wakes up, does whatever it is supposed to do, then goes back to sleep again. If you stop the process because it sleeps it will not be able to wake up once the signal comes.

I hope this helps.

bakunin

Thank you bakunin for the response , it is very much clear

one of the process has the following details , TIME+ means Total time of activity of this process, for process 29230 , is this active for 667 hours , means 27 days ,but the server itself did not exist 20 days ago, it is a fresh installation started 10 days ago, how to understand 29230 process

  PID USER      PR  NI  VIRT  RES  SHR S   %CPU %MEM    TIME+  COMMAND 
29230 oraSLV    20   0 8997m 4.4g 4.4g S      0 14.0 667:10.44 oracle

According to your first top this server has been up and running for 36 days:

Your server is pegged by those processed that I have highlighted in red. They are using most of the cpu cycles. %id in red indicates the cpu available (idle) and you have almost nothing. %us indicate what percentage of the cpu usage is being utilized by user space instead of system space (kernel) which it is indicated with %sy

hi aia

You cought be right , but I meant was

process 29230 oraSLV is related to Oracle for the instance SLV , and the oracle installation happened 10 days ago,
how come the red marked processes , which are all related to oracle, showing running from 708 hours (least one)
that is from 29 days approximately ,I am really confused here.
The oracle Instance SLV came into existence 10 days ago, but the related process is showing of 29 days old ,how to investigate on this

Thanks for response

Taking 793:38.88 as an example.
That's not 793 hours, but 793 minutes. 38.88 seconds (in 100th of a second)
M:S.S
Roughly over 13 hours.

Thanks for the clarification

did not give the correct understanding of TIME+

it only said : TIME+ �This is the total time of activity of this process (0:17.75)

Regards