6

I'm running Debian Lenny (x86_64) on a cloud VPS (Xen) and top command tells me there are 210 processes running and 209 are sleeping:

top - 14:49:29 up 15:18,  1 user,  load average: 0.09, 0.11, 0.05
Tasks: 210 total,   1 running, 209 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    532288k total,   437316k used,    94972k free,    30584k buffers
Swap:  1048568k total,      408k used,  1048160k free,   219772k cached

And here is what ps aux command gives me:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  10380   812 ?        Ss   Sep30   0:00 init [2]
root         2  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/0]
root         4  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/0]
root         6  0.0  0.0      0     0 ?        S<   Sep30   0:00 [khelper]
root         7  0.0  0.0      0     0 ?        S<   Sep30   0:05 [xenwatch]
root         8  0.0  0.0      0     0 ?        S<   Sep30   0:13 [xenbus]
root        10  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/1]
root        11  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/1]
root        12  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/1]
root        13  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/2]
root        14  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/2]
root        15  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/2]
root        16  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/3]
root        17  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/3]
root        18  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/3]
root        19  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/4]
root        20  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/4]
root        21  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/4]
root        22  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/5]
root        23  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/5]
root        24  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/5]
root        25  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/6]
root        26  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/6]
root        27  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/6]
root        28  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/7]
root        29  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/7]
root        30  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/7]
root        31  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/8]
root        32  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/8]
root        33  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/8]
root        34  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/9]
root        35  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/9]
root        36  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/9]
root        37  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/10]
root        38  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/10]
root        39  0.0  0.0      0     0 ?        S<   Sep30   0:04 [events/10]
root        40  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/11]
root        41  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/11]
root        42  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/11]
root        43  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/12]
root        44  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/12]
root        45  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/12]
root        46  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/13]
root        47  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/13]
root        48  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/13]
root        49  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/14]
root        50  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/14]
root        51  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/14]
root        52  0.0  0.0      0     0 ?        S<   Sep30   0:00 [migration/15]
root        53  0.0  0.0      0     0 ?        S<   Sep30   0:00 [ksoftirqd/15]
root        54  0.0  0.0      0     0 ?        S<   Sep30   0:00 [events/15]
root        55  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/0]
root        56  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/1]
root        57  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/2]
root        58  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/3]
root        59  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/4]
root        60  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/5]
root        61  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/6]
root        62  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/7]
root        63  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/8]
root        64  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/9]
root        65  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/10]
root        66  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/11]
root        67  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/12]
root        68  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/13]
root        69  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/14]
root        70  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kintegrityd/15]
root        71  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/0]
root        72  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/1]
root        73  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/2]
root        74  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/3]
root        75  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/4]
root        76  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/5]
root        77  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/6]
root        78  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/7]
root        79  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/8]
root        80  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/9]
root        81  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/10]
root        82  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/11]
root        83  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/12]
root        84  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/13]
root        85  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/14]
root        86  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kblockd/15]
root        87  0.0  0.0      0     0 ?        S<   Sep30   0:00 [cqueue]
root        88  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kseriod]
root        89  0.0  0.0      0     0 ?        S    Sep30   0:00 [pdflush]
root        90  0.0  0.0      0     0 ?        S    Sep30   0:00 [pdflush]
root        91  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kswapd0]
root        92  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/0]
root        93  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/1]
root        94  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/2]
root        95  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/3]
root        96  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/4]
root        97  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/5]
root        98  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/6]
root        99  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/7]
root       100  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/8]
root       101  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/9]
root       102  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/10]
root       103  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/11]
root       104  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/12]
root       105  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/13]
root       106  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/14]
root       107  0.0  0.0      0     0 ?        S<   Sep30   0:00 [aio/15]
root       108  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kpsmoused]
root       167  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/0]
root       168  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/1]
root       169  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/2]
root       170  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/3]
root       171  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/4]
root       172  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/5]
root       173  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/6]
root       174  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/7]
root       175  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/8]
root       176  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/9]
root       177  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/10]
root       178  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/11]
root       179  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/12]
root       180  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/13]
root       181  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/14]
root       182  0.0  0.0      0     0 ?        S<   Sep30   0:00 [net_accel/15]
root       315  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfs_mru_cache]
root       316  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/0]
root       317  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/1]
root       318  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/2]
root       319  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/3]
root       320  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/4]
root       321  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/5]
root       322  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/6]
root       323  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/7]
root       324  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/8]
root       325  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/9]
root       326  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/10]
root       327  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/11]
root       328  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/12]
root       329  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/13]
root       330  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/14]
root       331  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfslogd/15]
root       332  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/0]
root       333  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/1]
root       334  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/2]
root       335  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/3]
root       336  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/4]
root       337  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/5]
root       338  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/6]
root       339  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/7]
root       340  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/8]
root       341  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/9]
root       342  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/10]
root       343  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/11]
root       344  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/12]
root       345  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/13]
root       346  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/14]
root       347  0.0  0.0      0     0 ?        S<   Sep30   0:00 [xfsdatad/15]
root       399  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsIO]
root       400  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       401  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       402  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       403  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       404  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       405  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       406  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       407  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       408  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       409  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       410  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       411  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       412  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       413  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       414  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       415  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsCommit]
root       416  0.0  0.0      0     0 ?        S<   Sep30   0:00 [jfsSync]
root       673  0.0  0.0      0     0 ?        S<   Sep30   0:00 [kjournald]
root       727  0.0  0.1  16840   960 ?        S<s  Sep30   0:00 udevd --daemon
root      1273  0.0  0.3 122036  2016 ?        Sl   Sep30   0:00 /usr/sbin/rsyslogd -c3
root      1306  0.0  0.2  48960  1224 ?        Ss   Sep30   0:00 /usr/sbin/sshd
root      1809  0.0  0.2  21276  1076 ?        Ss   Sep30   0:00 /usr/sbin/cron
root      1873  0.0  1.5  41460  8360 ?        Ss   Sep30   0:02 /usr/sbin/munin-node
root      1896  0.0  0.1   3864   608 tty1     Ss+  Sep30   0:00 /sbin/getty 38400 tty1
root      1897  0.0  0.1   3864   604 tty2     Ss+  Sep30   0:00 /sbin/getty 38400 tty2
root      1898  0.0  0.1   3864   604 tty3     Ss+  Sep30   0:00 /sbin/getty 38400 tty3
root      1899  0.0  0.1   3864   608 tty4     Ss+  Sep30   0:00 /sbin/getty 38400 tty4
root      1900  0.0  0.1   3864   608 tty5     Ss+  Sep30   0:00 /sbin/getty 38400 tty5
root      1901  0.0  0.1   3864   604 tty6     Ss+  Sep30   0:00 /sbin/getty 38400 tty6
101       4526  0.0  0.1  42820  1052 ?        Ss   12:27   0:00 /usr/sbin/exim4 -bd -q30m
root      8865  0.0  0.2  11668  1432 pts/0    S    13:18   0:00 /bin/sh /usr/bin/mysqld_safe
mysql     8980  0.0  9.0 175284 48368 pts/0    Sl   13:18   0:05 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/my
root      8981  0.0  0.1   6480   684 pts/0    S    13:18   0:00 logger -t mysqld -p daemon.error
root     13730  0.0  0.8 149144  4712 ?        Ss   14:05   0:00 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data 13731  0.2 11.4 172756 61136 ?        S    14:05   0:05 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data 13732  0.2  8.9 158516 47712 ?        S    14:05   0:05 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data 13733  0.1  8.1 156576 43468 ?        S    14:05   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
root     14601  0.0  0.2  30600  1240 ?        Ss   14:15   0:00 nginx: master process /usr/sbin/nginx
www-data 14602  0.0  0.3  30976  1836 ?        S    14:15   0:00 nginx: worker process
www-data 14603  0.0  0.3  30976  1836 ?        S    14:15   0:00 nginx: worker process
www-data 14604  0.0  0.5  31552  2852 ?        S    14:15   0:00 nginx: worker process
www-data 14605  0.0  0.4  31240  2580 ?        S    14:15   0:00 nginx: worker process
www-data 14606  0.0  0.3  30976  1836 ?        S    14:15   0:00 nginx: worker process
www-data 14607  0.0  0.3  30976  1836 ?        S    14:15   0:00 nginx: worker process
www-data 14608  0.0  0.4  31244  2536 ?        S    14:15   0:00 nginx: worker process
www-data 14609  0.0  0.5  31544  2788 ?        S    14:15   0:00 nginx: worker process
root     17169  0.0  0.2  17456  1160 pts/0    R+   14:45   0:00 ps aux
root     26391  0.0  0.6  66168  3284 ?        Ss   10:32   0:00 sshd: root@notty
root     26394  0.0  0.3  42376  2120 ?        Ss   10:32   0:00 /usr/lib/openssh/sftp-server
root     31500  0.0  0.6  66140  3248 ?        Ss   11:33   0:00 sshd: root@pts/0
root     31503  0.0  0.3  20248  1924 pts/0    Ss   11:33   0:00 -bash
root     31509  0.0  0.6  66168  3264 ?        Ss   11:34   0:00 sshd: root@notty
root     31512  0.0  0.3  42180  1984 ?        Ss   11:34   0:00 /usr/lib/openssh/sftp-server

I'm wondering if this is normal situation? Do I need all of those process?

Thanks for any suggestions!

2 Answers2

5

I'm wondering if this is normal situation? Do I need all of those process?

It is normal for a server with no load. Many of the processes is the kernel threads. Many core - many processes(you have 16 core).

bindbn
  • 5,153
  • 2
  • 26
  • 23
-4

The total number of sleeping processes is not important. If it's over 400 the system dies though.What is important is the number of sleeping nginx and php-fpm processes. You use some public cloud. These thing are cheap and they promise the moon but in fact they are big pain in the ass. They lower the load and can handle more traffic in theory but with dedicated server it's hard to get many sleeping processes unless the server has problems with a hard drive or the hard drive controller. The reason for sleeping processes in clouds is bad I/O between the cloud nodes .MySQL on cloud is a big disaster it is the main reason to increase the average load CPU usage.As a %CPU as a process it can be over 1000% which is pretty crazy. They use the lan conectivity for everything and there's a lot of traffic generate d by the "mother" layer not your guest OS (CentOS,Debian etc). Sometimes even the back-up system of the cloud can cause the processes to "fall asleep". If you use PHP sessions that means even more sleeping processes. You can lower them if you use memcached serving the pages directly from the memory. That can be used if your pages are mainly "static".