502错误,并且swap内存一直占满状态
军哥,求助,网站是小站,基本没人访问,但是今天报502错误,并且swap内存一直占满状态,我重启了下php-fpm,好了点,但是马上内存又开始占满了。。。。回复 1# 的帖子
我看置顶教程里面有这么介绍的"可能因为phpcgi进程不够用而造成502,需要修改/usr/local/php/etc/php-fpm.conf 将其中的max_children值适当增加",我设置大一些以后好像是正常了。但是我的网站目前只有我一个人在测试使用,怎么会出现进程不够。。。
[ 本帖最后由 604542720 于 2016-1-17 14:43 编辑 ] swap都用完那就内存不够用了
不是说你一个人访问他内存就不占用了,你vps什么配置?
回复 3# 的帖子
1G 物理内存,2G swap,跑了个wordpresspm = dynamic
pm.max_children = 20
pm.start_servers = 6
pm.min_spare_servers = 3
pm.max_spare_servers = 20
我修改成这种配置了
回复 4# 的帖子
按这个设置的话应该不会,top看一下回复 5# 的帖子
而且我感觉改了php-fpm 的这些参数后,网站变的很慢了,经常需要重启php-fpm才能瞬间打开网站,但是过了一会后,又变慢了。。。php-fpm日志是这样的NOTICE: fpm is running, pid 31981
NOTICE: ready to handle connections
WARNING: seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 12 total children
WARNING: seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 15 total children
WARNING: seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 18 total children
WARNING: seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 2 idle, and 21 total children
WARNING: seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 22 total children
WARNING: server reached pm.max_children setting (25), consider raising it
http://i8.tietuku.com/0c96d2c5bc38561b.png
这个是慢日志,已经到了刷新探针页面都卡的地步了。。。。。网站目前是测试阶段,基本上就我一个人访问。。。
http://i4.tietuku.com/20ed5315666f7d08.png
[ 本帖最后由 604542720 于 2016-1-20 00:03 编辑 ]
1
解决了,是被人攻击了xmlrpc文件,重命名这个文件就可以了,一般来说这个文件作用不大
页:
[1]