为什么我的 Ubuntu Xenial(16.04)服务器上运行了这么多进程?

为什么我的 Ubuntu Xenial(16.04)服务器上运行了这么多进程?

我是一名新手服务器管理员。我的服务器上有 4 个网站在 nginx 上运行。有时速度会变慢,我不得不重启机器。很快我将为我的客户部署网站,不能冒服务器崩溃的风险。我认为正在运行的进程太多了,但实际上我还不知道 174 个进程是否是正常数字。

$ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0 154484  5184 ?        Ss   Jul11   0:55 /sbin/init
root         2  0.0  0.0      0     0 ?        S    Jul11   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/0:0H]
root         7  0.0  0.0      0     0 ?        S    Jul11   2:33 [rcu_sched]
root         8  0.0  0.0      0     0 ?        S    Jul11   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    Jul11   0:00 [migration/0]
root        10  0.0  0.0      0     0 ?        S<   Jul11   0:00 [lru-add-drain]
root        11  0.0  0.0      0     0 ?        S    Jul11   0:10 [watchdog/0]
root        12  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/0]
root        13  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/1]
root        14  0.0  0.0      0     0 ?        S    Jul11   0:06 [watchdog/1]
root        15  0.0  0.0      0     0 ?        S    Jul11   0:04 [migration/1]
root        16  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/1]
root        18  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/1:0H]
root        19  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/2]
root        20  0.0  0.0      0     0 ?        S    Jul11   0:08 [watchdog/2]
root        21  0.0  0.0      0     0 ?        S    Jul11   0:00 [migration/2]
root        22  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/2]
root        24  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/2:0H]
root        25  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/3]
root        26  0.0  0.0      0     0 ?        S    Jul11   0:06 [watchdog/3]
root        27  0.0  0.0      0     0 ?        S    Jul11   0:00 [migration/3]
root        28  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/3]
root        30  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/3:0H]
root        31  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/4]
root        32  0.0  0.0      0     0 ?        S    Jul11   0:08 [watchdog/4]
root        33  0.0  0.0      0     0 ?        S    Jul11   0:00 [migration/4]
root        34  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/4]
root        36  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/4:0H]
root        37  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/5]
root        38  0.0  0.0      0     0 ?        S    Jul11   0:06 [watchdog/5]
root        39  0.0  0.0      0     0 ?        S    Jul11   0:00 [migration/5]
root        40  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/5]
root        42  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/5:0H]
root        43  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/6]
root        44  0.0  0.0      0     0 ?        S    Jul11   0:08 [watchdog/6]
root        45  0.0  0.0      0     0 ?        S    Jul11   0:00 [migration/6]
root        46  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/6]
root        48  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/6:0H]
root        49  0.0  0.0      0     0 ?        S    Jul11   0:00 [cpuhp/7]
root        50  0.0  0.0      0     0 ?        S    Jul11   0:06 [watchdog/7]
root        51  0.0  0.0      0     0 ?        S    Jul11   0:00 [migration/7]
root        52  0.0  0.0      0     0 ?        S    Jul11   0:00 [ksoftirqd/7]
root        54  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/7:0H]
root        55  0.0  0.0      0     0 ?        S    Jul11   0:00 [kdevtmpfs]
root        56  0.0  0.0      0     0 ?        S<   Jul11   0:00 [netns]
root        57  0.0  0.0      0     0 ?        S    Jul11   0:04 [khungtaskd]
root        58  0.0  0.0      0     0 ?        S    Jul11   0:00 [oom_reaper]
root        59  0.0  0.0      0     0 ?        S<   Jul11   0:00 [writeback]
root        60  0.0  0.0      0     0 ?        S    Jul11   0:00 [kcompactd0]
root        61  0.0  0.0      0     0 ?        SN   Jul11   0:00 [ksmd]
root        62  0.0  0.0      0     0 ?        SN   Jul11   0:23 [khugepaged]
root        63  0.0  0.0      0     0 ?        S<   Jul11   0:00 [crypto]
root        64  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kintegrityd]
root        65  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root        66  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kblockd]
root        67  0.0  0.0      0     0 ?        S<   Jul11   0:00 [ata_sff]
root        68  0.0  0.0      0     0 ?        S<   Jul11   0:00 [md]
root        69  0.0  0.0      0     0 ?        S<   Jul11   0:00 [devfreq_wq]
root        70  0.0  0.0      0     0 ?        S<   Jul11   0:00 [watchdogd]
root        75  0.0  0.0      0     0 ?        S    Jul11   0:00 [kswapd0]
root        76  0.0  0.0      0     0 ?        S<   Jul11   0:00 [vmstat]
root        77  0.0  0.0      0     0 ?        S    Jul11   0:00 [ecryptfs-kthrea]
root       116  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kthrotld]
root       118  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       119  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       120  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       121  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       122  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       123  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       124  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       125  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       126  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       127  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       128  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       129  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       130  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       131  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       132  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       133  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       134  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       135  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       136  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       137  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       138  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       139  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       140  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       141  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       142  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       143  0.0  0.0      0     0 ?        S<   Jul11   0:00 [bioset]
root       144  0.0  0.0      0     0 ?        S<   Jul11   0:00 [ipv6_addrconf]
root       165  0.0  0.0      0     0 ?        S<   Jul11   0:00 [charger_manager]
root       678  0.0  0.0      0     0 ?        S<   Jul11   0:31 [kworker/0:1H]
root       826  0.0  0.0      0     0 ?        S    09:02   0:00 [kworker/u16:1]
root       889  0.0  0.0      0     0 ?        S<   Jul11   0:02 [kworker/2:1H]
root       890  0.0  0.0      0     0 ?        S    Jul11   0:45 [jbd2/vda-8]
root       891  0.0  0.0      0     0 ?        S<   Jul11   0:00 [ext4-rsv-conver]
root       892  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/1:1H]
root      1305  0.0  0.0  10892  5736 ?        Ss   10:01   0:00 sshd: root@pts/0
root      1437  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/3:1H]
root      1453  0.0  0.0      0     0 ?        S    Jul11   0:00 [kauditd]
root      1464  0.0  0.0  12920  3084 ?        Ss   Jul11   0:04 /lib/systemd/systemd-udevd
root      1467  0.0  0.0   7604  4336 ?        Ss   Jul11   0:23 /usr/sbin/haveged --Foreground --verbose=1 -w 1024
root      1470  0.0  0.1  20788  8468 ?        Ss   Jul11   8:06 /lib/systemd/systemd-journald
root      1527  0.0  0.0   6148  4200 pts/0    Ss+  10:01   0:00 -bash
message+  1554  0.0  0.0   5928  3228 ?        Ss   Jul11   0:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root      1573  0.0  0.0   5136  2548 ?        Ss   Jul11   0:09 /usr/sbin/cron -f
root      1585  0.0  0.0   3416   728 ?        Ss   Jul11   0:05 /lib/systemd/systemd-logind
syslog    1588  0.0  0.0 225856  3668 ?        Ssl  Jul11   2:37 /usr/sbin/rsyslogd -n
root      1655  0.0  0.0  47272  6872 ?        Ss   Jul11   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
postfix   1658  0.0  0.0  34232  3788 ?        S    10:31   0:00 anvil -l -t unix -u -c
root      1664  0.0  0.0      0     0 ?        S    10:38   0:00 [kworker/u16:0]
root      1667  0.0  0.0  10892  5544 ?        Rs   10:39   0:00 sshd: root@pts/1
root      1673  0.0  0.0   4068  1436 tty1     Ss+  Jul11   0:00 /sbin/agetty --noclear tty1 linux
root      1677  0.0  0.0   3884  1776 ttyAMA0  Ss+  Jul11   0:00 /sbin/agetty --keep-baud 115200 38400 9600 ttyAMA0 vt220
root      1700  0.0  0.0   9772  5304 ?        Ss   Jul11   1:55 /usr/sbin/sshd -D
ntp       1782  0.0  0.0  14524  4116 ?        Ss   Jul11   3:59 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /var/lib/ntp/ntp.conf.dhcp -u 106:110
root      1793  0.0  0.0   5180  2524 ?        Ss   Jul11   0:00 /sbin/dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
root      1889  0.0  0.0   6148  4172 pts/1    Ss   10:39   0:00 -bash
postfix   1908  0.0  0.0  34232  3888 ?        S    10:41   0:00 pickup -l -t unix -u -c
postfix   1933  0.0  0.0  37456  7604 ?        S    10:45   0:00 smtpd -n smtp -t inet -u -c -o stress=
postfix   1934  0.0  0.0  34232  3852 ?        S    10:45   0:00 proxymap -t unix -u
root      1942  0.0  0.0      0     0 ?        S    10:46   0:00 [kworker/u16:2]
root      1943  0.5  0.0   9772  5280 ?        Ss   10:46   0:00 sshd: [accepted]
sshd      1944  0.0  0.0   9772  1824 ?        S    10:46   0:00 sshd: [net]
root      1945  0.0  0.0   7140  2844 pts/1    R+   10:46   0:00 ps aux
root      1960  0.0  0.0  34152  3856 ?        Ss   Jul11   0:41 /usr/lib/postfix/sbin/master
postfix   1963  0.0  0.0  34276  3880 ?        S    Jul11   0:05 qmgr -l -t unix -u
root      1965  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/6:1H]
root      1970  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/4:1H]
postfix   1977  0.0  0.0  37004  6048 ?        S    Jul11   0:06 tlsmgr -l -t unix -u -c
root      1996  0.0  0.0      0     0 ?        S<   Jul11   0:00 [kworker/7:1H]
root      2436  0.0  0.0      0     0 ?        S<   Jul12   0:00 [kworker/5:1H]
martina   5619  0.0  0.4  45040 35108 ?        S    Jul12   3:55 /home/martina/www/portfoliomga/.virtualenv/bin/uwsgi -H /home/martina/www/portfoliomga/.virtualenv --ini /home/martina/www/portfoliomga/
martina   5622  0.0  0.4 712316 36064 ?        Sl   Jul12   0:00 /home/martina/www/portfoliomga/.virtualenv/bin/uwsgi -H /home/martina/www/portfoliomga/.virtualenv --ini /home/martina/www/portfoliomga/
martina   5623  0.0  0.4 714340 38836 ?        Sl   Jul12   0:00 /home/martina/www/portfoliomga/.virtualenv/bin/uwsgi -H /home/martina/www/portfoliomga/.virtualenv --ini /home/martina/www/portfoliomga/
martina   5624  0.0  0.4 714072 40080 ?        Sl   Jul12   0:01 /home/martina/www/portfoliomga/.virtualenv/bin/uwsgi -H /home/martina/www/portfoliomga/.virtualenv --ini /home/martina/www/portfoliomga/
martina   5627  0.0  0.5 713904 44624 ?        Sl   Jul12   0:04 /home/martina/www/portfoliomga/.virtualenv/bin/uwsgi -H /home/martina/www/portfoliomga/.virtualenv --ini /home/martina/www/portfoliomga/
martina   6045  0.0  0.4  45036 35116 ?        S    Jul12   3:54 /home/martina/www/websitemg/.virtualenv/bin/uwsgi -H /home/martina/www/websitemg/.virtualenv --ini /home/martina/www/websitemg/releases/
martina   6048  0.0  0.5 708588 42024 ?        Sl   Jul12   0:00 /home/martina/www/websitemg/.virtualenv/bin/uwsgi -H /home/martina/www/websitemg/.virtualenv --ini /home/martina/www/websitemg/releases/
martina   6049  0.0  0.6 714852 55000 ?        Sl   Jul12   0:05 /home/martina/www/websitemg/.virtualenv/bin/uwsgi -H /home/martina/www/websitemg/.virtualenv --ini /home/martina/www/websitemg/releases/
martina   6050  0.0  0.6 714848 53316 ?        Sl   Jul12   0:02 /home/martina/www/websitemg/.virtualenv/bin/uwsgi -H /home/martina/www/websitemg/.virtualenv --ini /home/martina/www/websitemg/releases/
martina   6051  0.0  0.5 708588 42008 ?        Sl   Jul12   0:00 /home/martina/www/websitemg/.virtualenv/bin/uwsgi -H /home/martina/www/websitemg/.virtualenv --ini /home/martina/www/websitemg/releases/
root      7319  0.0  0.0      0     0 ?        S    Jul28   0:00 [kworker/7:1]
root      8853  0.0  0.0      0     0 ?        S    Jul29   0:02 [kworker/3:2]
root     13453  0.0  0.0      0     0 ?        S    Jul26   0:00 [kworker/4:2]
root     14489  0.0  0.0      0     0 ?        S    Jul31   0:04 [kworker/0:0]
root     15260  0.0  0.0      0     0 ?        S    Jul31   0:00 [kworker/6:2]
root     15336  0.0  0.0      0     0 ?        S    Jul31   0:00 [kworker/2:0]
mysql    15490  0.1  2.1 1137608 176536 ?      Ssl  Jul31   3:23 /usr/sbin/mysqld
root     16086  0.0  0.0      0     0 ?        S    Jul26   0:01 [kworker/4:0]
root     20871  0.0  0.0      0     0 ?        S    Aug01   0:00 [kworker/6:0]
root     23630  0.0  0.0      0     0 ?        S    Aug01   0:00 [kworker/5:0]
root     26602  0.0  0.0      0     0 ?        S    Jul23   0:01 [kworker/3:1]
martina  27502  0.0  0.4  45244 35152 ?        S    Aug01   0:11 /home/martina/www/qs4bmg/.virtualenv/bin/uwsgi -H /home/martina/www/qs4bmg/.virtualenv --ini /home/martina/www/qs4bmg/releases/current/u
martina  27506  0.0  0.4 708796 34332 ?        Sl   Aug01   0:00 /home/martina/www/qs4bmg/.virtualenv/bin/uwsgi -H /home/martina/www/qs4bmg/.virtualenv --ini /home/martina/www/qs4bmg/releases/current/u
martina  27507  0.0  0.4 708796 34332 ?        Sl   Aug01   0:00 /home/martina/www/qs4bmg/.virtualenv/bin/uwsgi -H /home/martina/www/qs4bmg/.virtualenv --ini /home/martina/www/qs4bmg/releases/current/u
martina  27508  0.0  0.4 708796 34332 ?        Sl   Aug01   0:00 /home/martina/www/qs4bmg/.virtualenv/bin/uwsgi -H /home/martina/www/qs4bmg/.virtualenv --ini /home/martina/www/qs4bmg/releases/current/u
martina  27513  0.0  0.5 713404 42104 ?        Sl   Aug01   0:00 /home/martina/www/qs4bmg/.virtualenv/bin/uwsgi -H /home/martina/www/qs4bmg/.virtualenv --ini /home/martina/www/qs4bmg/releases/current/u
www-data 27564  0.0  0.0  47272  6148 ?        S    Aug01   0:08 nginx: worker process
www-data 27565  0.0  0.0  47272  7060 ?        S    Aug01   0:04 nginx: worker process
www-data 27566  0.0  0.0  47272  3868 ?        S    Aug01   0:11 nginx: worker process
www-data 27567  0.0  0.0  47272  3868 ?        S    Aug01   0:10 nginx: worker process
www-data 27568  0.0  0.0  47272  3868 ?        S    Aug01   0:09 nginx: worker process
www-data 27569  0.0  0.0  47272  6276 ?        S    Aug01   0:11 nginx: worker process
www-data 27570  0.0  0.0  47272  6276 ?        S    Aug01   0:11 nginx: worker process
www-data 27571  0.0  0.0  47272  3868 ?        S    Aug01   0:11 nginx: worker process
root     27572  0.0  0.0      0     0 ?        S    Aug01   0:00 [kworker/2:2]
root     27884  0.0  0.0      0     0 ?        S    Aug01   0:00 [kworker/1:1]
root     29663  0.0  0.0      0     0 ?        S    Aug01   0:01 [kworker/0:2]
root     30179  0.0  0.0      0     0 ?        S    Jul28   0:00 [kworker/7:0]
root     30566  0.0  0.0      0     0 ?        S    00:11   0:00 [kworker/1:2]
root     31478  0.0  0.0      0     0 ?        S    02:48   0:00 [kworker/5:1]

感谢您提供的任何提示。

相关内容