这段时间论坛一直不稳定,后台显示php-fpm进程过多,一般情况下10个就足够,没想到配置210个都不行
- cat /usr/local/php/etc/php-fpm.conf
- [global]
- pid = /usr/local/php/var/run/php-fpm.pid
- error_log = /usr/local/php/var/log/php-fpm.log
- log_level = notice
- [www]
- listen = /tmp/php-cgi.sock
- listen.backlog = -1
- listen.allowed_clients = 127.0.0.1
- listen.owner = www
- listen.group = www
- listen.mode = 0666
- user = www
- group = www
- pm = dynamic
- <b>pm.max_children = 210</b>
- pm.start_servers = 2
- pm.min_spare_servers = 1
- pm.max_spare_servers = 6
- request_terminate_timeout = 100
- request_slowlog_timeout = 1s
- slowlog = /usr/local/php/var/log/php-fpm.slow.log
复制代码
搜索了N久,没有一个确切的答复。
迫不得已去翻LOG文件
不看不知道,一看吓一跳,刚刚装上的LNMP,LOG文件居然3.5M!cat一下,半天也没显示完毕
- cat /usr/local/php/var/log/php-fpm.log
复制代码
接下来Google这个关键文件《RoundFirewall.php》
找到http://www.discuz.net/thread-3570450-1-1.html
细查一下,这个属于非必要文件,并且具有木马性质!
果断把/home/wwwroot/forum.wifihell.com/utility/文件夹删除!
效果立竿见影
- <b>Tasks: 40 total, 1 running, 39 sleeping</b>, 0 stopped, 0 zombie
- Cpu(s): 0.3%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
- Mem: 262144k total, 132924k used, 129220k free, 0k buffers
- Swap: 262144k total, 92940k used, 169204k free, 69144k cached
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
- 4808 root 20 0 104m 1116 908 S 0.3 0.4 0:15.26 axel
- 18926 www 20 0 31112 9212 4096 S 0.3 3.5 0:00.87 php-fpm
- 1 root 20 0 3356 1112 816 S 0.0 0.4 0:00.24 init
- 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd/10003
- 3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper/10003
- 251 root 20 0 2788 240 236 S 0.0 0.1 0:00.00 upstart-udev-br
- 272 root 20 0 2796 612 608 S 0.0 0.2 0:00.00 udevd
- 307 root 20 0 2792 256 252 S 0.0 0.1 0:00.00 udevd
- 308 root 20 0 2792 256 252 S 0.0 0.1 0:00.00 udevd
- 358 root 20 0 2800 156 152 S 0.0 0.1 0:00.00 upstart-socket-
- 576 root 20 0 6636 1264 1152 S 0.0 0.5 0:00.84 sshd
- 628 root 20 0 2572 680 616 S 0.0 0.3 0:00.00 cron
- 629 root 20 0 2516 656 652 S 0.0 0.3 0:00.00 xinetd
- 664 syslog 20 0 2356 668 596 S 0.0 0.3 0:01.08 syslogd
- 682 bind 20 0 50232 1416 1096 S 0.0 0.5 0:00.01 named
- 1171 root 20 0 79212 1860 636 S 0.0 0.7 0:00.62 memcached
- 1221 root 20 0 12944 376 372 S 0.0 0.1 0:00.00 saslauthd
- 1223 root 20 0 12944 44 40 S 0.0 0.0 0:00.00 saslauthd
- 1227 root 20 0 13700 2104 1128 S 0.0 0.8 0:01.51 supervisord
- 1235 nobody 20 0 13524 4072 1904 S 0.0 1.6 0:02.01 ssserver
- 1303 root 20 0 15100 900 700 S 0.0 0.3 0:00.26 sendmail-mta
- 1362 root 20 0 2356 544 540 S 0.0 0.2 0:00.00 getty
- 1368 root 20 0 2356 548 544 S 0.0 0.2 0:00.00 getty
- 1770 root 20 0 9564 1268 1264 S 0.0 0.5 0:04.51 sshd
- 1784 root 20 0 3920 656 652 S 0.0 0.3 0:00.05 bash
- 1843 root 20 0 9748 1412 1264 S 0.0 0.5 0:00.49 sshd
- 1855 root 20 0 3924 1452 1140 S 0.0 0.6 0:00.06 bash
- 15584 root 20 0 6308 352 288 S 0.0 0.1 0:00.00 nginx
- 15587 www 20 0 17208 1756 976 S 0.0 0.7 0:01.00 nginx
- 15588 root 20 0 28640 3212 1776 S 0.0 1.2 0:00.83 php-fpm
- 15605 root 20 0 2188 508 504 S 0.0 0.2 0:00.00 mysqld_safe
- 16039 mariadb 20 0 412m 9452 4320 S 0.0 3.6 0:00.67 mysqld
- 18927 www 20 0 32864 10m 4004 S 0.0 4.1 0:00.61 php-fpm
- 18928 www 20 0 32604 10m 4044 S 0.0 4.1 0:00.60 php-fpm
- 18930 www 20 0 35204 12m 4192 S 0.0 5.1 0:00.67 php-fpm
- 18931 www 20 0 34340 11m 3468 S 0.0 4.5 0:00.69 php-fpm
- 18932 www 20 0 32640 10m 4012 S 0.0 4.1 0:00.56 php-fpm
复制代码
目前论坛应该太平了,各项指数都下跌到了正常水平。
|