我正在使用配备 2CPU、8G Ram 和 160G HDD 的 Amazon LightSail。
CPU 负载不超过 20% 且内存小于 50%,Drupal 和 Wordpress 网站在服务重启或服务器重启时都非常快,但几分钟后突然变得非常慢。这是我的 htop 结果:
=======================================================
1 [|| 2.0%] Tasks: 113, 1182 thr; 1 running
2 [|| 2.0%] Load average: 0.17 0.13 0.11
Mem[||||||||||||||||||||||||||||||||| 2.34G/7.80G] Uptime: 06:18:48
Swp[0K/0K]
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
17383 bitnami 20 0 26816 4704 3260 R 2.6 0.1 0:01.35 htop
2157 bitnami 20 0 26672 4188 2796 S 1.3 0.1 5:08.24 htop
16929 daemon 20 0 406M 245M 134M S 0.7 3.1 0:15.41 php-fpm: pool www
16956 daemon 20 0 1731M 99420 54816 S 0.0 1.2 0:00.67 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
1528 root 20 0 285M 16368 6700 S 0.0 0.2 0:02.01 /usr/bin/python3 /usr/bin/fail2ban-server -s /var/r
15836 root 20 0 197M 66024 61552 S 0.0 0.8 0:00.23 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
17055 daemon 20 0 1720M 35144 27432 S 0.0 0.4 0:00.02 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
17098 daemon 20 0 1728M 50428 31152 S 0.0 0.6 0:00.08 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
15785 mysql 20 0 3902M 525M 19216 S 0.0 6.6 0:04.63 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/
15797 mysql 20 0 3902M 525M 19216 S 0.0 6.6 0:00.11 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/
16952 daemon 20 0 322M 155M 129M S 0.0 1.9 0:08.11 php-fpm: pool www
16932 daemon 20 0 398M 229M 127M S 0.0 2.9 0:29.88 php-fpm: pool www
15853 daemon 20 0 1728M 53672 31476 S 0.0 0.7 0:00.91 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
16930 mysql 20 0 3902M 525M 19216 S 0.0 6.6 0:01.38 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/
17105 mysql 20 0 3902M 525M 19216 S 0.0 6.6 0:00.61 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/
16794 daemon 20 0 1728M 95852 54828 S 0.0 1.2 0:00.07 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
1394 root 20 0 269M 6036 5072 S 0.0 0.1 0:00.78 /usr/lib/accountsservice/accounts-daemon
15796 mysql 20 0 3902M 525M 19216 S 0.0 6.6 0:00.03 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/
15849 daemon 20 0 1731M 99420 54816 S 0.0 1.2 0:04.16 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
16933 mysql 20 0 3902M 525M 19216 S 0.0 6.6 0:01.20 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/
15851 daemon 20 0 1728M 95852 54828 S 0.0 1.2 0:03.54 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
433 root 20 0 12204 4740 1616 S 0.0 0.1 0:04.84 /usr/sbin/haveged --Foreground --verbose=1 -w 1024
16921 daemon 20 0 333M 121M 86616 S 0.0 1.5 0:06.44 php-fpm: pool www
16870 daemon 20 0 1731M 99420 54816 S 0.0 1.2 0:00.01 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
16931 daemon 20 0 355M 181M 122M S 0.0 2.3 0:07.41 php-fpm: pool www
16950 daemon 20 0 1731M 99420 54816 S 0.0 1.2 0:01.23 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
16949 daemon 20 0 1731M 99420 54816 S 0.0 1.2 0:00.55 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/
=========================================
我注意到 php-fpm www 池花费了很长时间。
我的 Apache 错误日志的最后几行:
54.36.108.162:43147] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:52:28.137313 2019] [proxy_fcgi:error] [pid 7246:tid 140430372849408] [client 127.0.0.1:53566] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:52:28.138640 2019] [proxy_fcgi:error] [pid 7246:tid 140430624630528] [client 127.0.0.1:53568] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:52:28.693027 2019] [proxy_fcgi:error] [pid 7264:tid 140430507132672] [client 163.172.66.247:60252] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:52:29.711571 2019] [proxy_fcgi:error] [pid 7264:tid 140430716950272] [client 54.36.108.162:43147] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:52:30.587409 2019] [proxy_fcgi:error] [pid 7264:tid 140430557488896] [client 163.172.66.247:60252] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:52:31.723761 2019] [proxy_fcgi:error] [pid 7246:tid 140430844696320] [client 127.0.0.1:54172] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:52:31.938670 2019] [proxy_fcgi:error] [pid 7264:tid 140430674986752] [client 127.0.0.1:54204] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:52:32.752152 2019] [proxy_fcgi:error] [pid 7246:tid 140430574274304] [client 199.249.230.64:5251] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:52:34.298572 2019] [proxy_fcgi:error] [pid 7246:tid 140430716950272] [client 199.249.230.64:5561] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:04.738834 2019] [proxy_fcgi:error] [pid 7246:tid 140430607845120] [client 199.249.230.64:5251] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:04.959442 2019] [proxy_fcgi:error] [pid 7246:tid 140430481954560] [client 127.0.0.1:59048] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:04.960023 2019] [proxy_fcgi:error] [pid 7246:tid 140430431598336] [client 127.0.0.1:41786] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:07.572530 2019] [proxy_fcgi:error] [pid 7264:tid 140430733735680] [client 127.0.0.1:59530] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:07.573123 2019] [proxy_fcgi:error] [pid 7256:tid 140430406420224] [client 127.0.0.1:42248] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:12.689832 2019] [proxy_fcgi:error] [pid 7246:tid 140430725342976] [client 199.249.230.64:5251] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:12.691932 2019] [proxy_fcgi:error] [pid 7264:tid 140430255351552] [client 127.0.0.1:42634] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:12.772663 2019] [proxy_fcgi:error] [pid 7264:tid 140430532310784] [client 127.0.0.1:43364] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:12.778137 2019] [proxy_fcgi:error] [pid 7264:tid 140430591059712] [client 127.0.0.1:43378] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:12.783498 2019] [proxy_fcgi:error] [pid 7264:tid 140430827910912] [client 127.0.0.1:43380] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:12.790286 2019] [access_compat:error] [pid 7258:tid 140430616237824] [client 127.0.0.1:43382] AH01797: client denied by server configuration: /opt/bitnami/apache2/htdocs/xmlrpc.php
[Sun Aug 25 05:53:23.467214 2019] [proxy_fcgi:error] [pid 7264:tid 140430288922368] [client 185.220.101.27:45741] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:23.468534 2019] [proxy_fcgi:error] [pid 7256:tid 140430372849408] [client 127.0.0.1:33968] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:23.470151 2019] [proxy_fcgi:error] [pid 7246:tid 140430532310784] [client 127.0.0.1:33982] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:23.471434 2019] [proxy_fcgi:error] [pid 7256:tid 140430356064000] [client 127.0.0.1:33984] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:23.472842 2019] [proxy_fcgi:error] [pid 7256:tid 140430339278592] [client 127.0.0.1:33986] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:26.680143 2019] [proxy_fcgi:error] [pid 7246:tid 140430700164864] [client 84.17.47.136:63518] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/boltnutri.com/wp-content/wflogs/config-synced.php for reading and writing.\n', referer: http://boltnutri.com/
[Sun Aug 25 05:53:27.216602 2019] [proxy_fcgi:error] [pid 7246:tid 140430633023232] [client 185.220.101.27:33981] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:29.015352 2019] [proxy_fcgi:error] [pid 7264:tid 140430339278592] [client 127.0.0.1:34504] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:30.522879 2019] [proxy_fcgi:error] [pid 7264:tid 140430819518208] [client 84.17.47.136:63815] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/boltnutri.com/wp-content/wflogs/config-synced.php for reading and writing.\n', referer: http://www.boltnutri.com/
[Sun Aug 25 05:53:30.569325 2019] [proxy_fcgi:error] [pid 7246:tid 140430280529664] [client 127.0.0.1:34826] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.101313 2019] [proxy_fcgi:error] [pid 7246:tid 140430819518208] [client 127.0.0.1:35102] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.102655 2019] [proxy_fcgi:error] [pid 7264:tid 140430381242112] [client 127.0.0.1:35202] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.103120 2019] [proxy_fcgi:error] [pid 7264:tid 140430557488896] [client 127.0.0.1:35220] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.104144 2019] [proxy_fcgi:error] [pid 7264:tid 140430674986752] [client 127.0.0.1:35222] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.105301 2019] [proxy_fcgi:error] [pid 7246:tid 140430844696320] [client 127.0.0.1:35226] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.106564 2019] [proxy_fcgi:error] [pid 7264:tid 140430305707776] [client 127.0.0.1:35228] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.107907 2019] [proxy_fcgi:error] [pid 7246:tid 140430574274304] [client 127.0.0.1:35230] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:31.109159 2019] [proxy_fcgi:error] [pid 7258:tid 140430591059712] [client 127.0.0.1:35232] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:45.256738 2019] [proxy_fcgi:error] [pid 7246:tid 140430658201344] [client 127.0.0.1:37356] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:45.258327 2019] [proxy_fcgi:error] [pid 7258:tid 140430314100480] [client 127.0.0.1:37360] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:46.250021 2019] [proxy_fcgi:error] [pid 7246:tid 140430599452416] [client 127.0.0.1:37554] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:46.251251 2019] [proxy_fcgi:error] [pid 7246:tid 140430272136960] [client 127.0.0.1:37558] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:48.114389 2019] [proxy_fcgi:error] [pid 7246:tid 140430557488896] [client 185.220.101.48:46339] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:51.980481 2019] [proxy_fcgi:error] [pid 7246:tid 140430398027520] [client 51.15.43.205:51460] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:53.714783 2019] [proxy_fcgi:error] [pid 7246:tid 140430481954560] [client 185.220.101.48:46339] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:54.474000 2019] [proxy_fcgi:error] [pid 7246:tid 140430565881600] [client 51.15.43.205:51460] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:54.474970 2019] [proxy_fcgi:error] [pid 7264:tid 140430582667008] [client 127.0.0.1:50190] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.480284 2019] [proxy_fcgi:error] [pid 7264:tid 140430844696320] [client 127.0.0.1:50278] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.486058 2019] [proxy_fcgi:error] [pid 7246:tid 140430431598336] [client 127.0.0.1:50280] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.491154 2019] [proxy_fcgi:error] [pid 7258:tid 140430515525376] [client 127.0.0.1:50282] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.496413 2019] [proxy_fcgi:error] [pid 7246:tid 140430414812928] [client 127.0.0.1:50284] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.504865 2019] [proxy_fcgi:error] [pid 7246:tid 140430322493184] [client 127.0.0.1:50288] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.509886 2019] [proxy_fcgi:error] [pid 7246:tid 140430465169152] [client 127.0.0.1:50290] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.515117 2019] [proxy_fcgi:error] [pid 7246:tid 140430364456704] [client 127.0.0.1:50292] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:53:54.520130 2019] [access_compat:error] [pid 7246:tid 140430674986752] [client 127.0.0.1:50294] AH01797: client denied by server configuration: /opt/bitnami/apache2/htdocs/xmlrpc.php
[Sun Aug 25 05:53:56.091301 2019] [proxy_fcgi:error] [pid 7246:tid 140430811125504] [client 162.220.162.10:53928] AH01071: Got error 'PHP message: Unable to open /opt/bitnami/apache2/htdocs/iconnect-mm.com/wp-content/wflogs/ips.php for reading and writing.\n'
[Sun Aug 25 05:53:59.277311 2019] [autoindex:error] [pid 7246:tid 140430624630528] [client 54.36.150.170:24672] AH01276: Cannot serve directory /opt/bitnami/apache2/htdocs/ecd.gov.mm/sites/all/modules/ctools/ctools_custom_content/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive
[Sun Aug 25 05:53:59.925716 2019] [proxy_fcgi:error] [pid 7246:tid 140430827910912] [client 127.0.0.1:51606] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:54:00.121587 2019] [proxy_fcgi:error] [pid 7246:tid 140430448383744] [client 127.0.0.1:51668] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:54:00.329811 2019] [proxy_fcgi:error] [pid 7246:tid 140430255351552] [client 127.0.0.1:51716] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:54:00.556125 2019] [proxy_fcgi:error] [pid 7246:tid 140430439991040] [client 127.0.0.1:51766] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:54:00.722575 2019] [proxy_fcgi:error] [pid 7264:tid 140430448383744] [client 127.0.0.1:51810] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:54:00.955556 2019] [proxy_fcgi:error] [pid 7264:tid 140430853089024] [client 127.0.0.1:51882] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:54:00.961745 2019] [access_compat:error] [pid 7246:tid 140430288922368] [client 127.0.0.1:51886] AH01797: client denied by server configuration: /opt/bitnami/apache2/htdocs/xmlrpc.php
[Sun Aug 25 05:54:18.482709 2019] [negotiation:error] [pid 7246:tid 140430473561856] [client 65.18.120.92:31071] AH00687: Negotiation: discovered file(s) matching request: /opt/bitnami/apache2/htdocs/umfccicentennialexpo.com/index.html (None could be negotiated)., referer: http://m.facebook.com/
[Sun Aug 25 05:54:29.695334 2019] [proxy_fcgi:error] [pid 7246:tid 140430280529664] [client 127.0.0.1:42528] AH01071: Got error 'Primary script unknown\n'
[Sun Aug 25 05:54:30.373033 2019] [proxy_fcgi:error] [pid 7246:tid 140430733735680] [client 127.0.0.1:42910] AH01071: Got error 'Primary script unknown\n'