VPS侦探论坛

 找回密码
 注册
查看: 4834|回复: 6

502错误,并且swap内存一直占满状态

[复制链接]
发表于 2016-1-17 14:25:06 | 显示全部楼层 |阅读模式

军哥,求助,网站是小站,基本没人访问,但是今天报502错误,并且swap内存一直占满状态,我重启了下php-fpm,好了点,但是马上内存又开始占满了。。。。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-1-17 14:37:24 | 显示全部楼层

回复 1# 的帖子



我看置顶教程里面有这么介绍的  "可能因为phpcgi进程不够用而造成502,需要修改/usr/local/php/etc/php-fpm.conf 将其中的max_children值适当增加",  我设置大一些以后好像是正常了。

但是我的网站目前只有我一个人在测试使用,怎么会出现进程不够。。。

[ 本帖最后由 604542720 于 2016-1-17 14:43 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-1-18 09:08:27 | 显示全部楼层

swap都用完那就内存不够用了

不是说你一个人访问他内存就不占用了,你vps什么配置?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-1-18 22:55:02 | 显示全部楼层

回复 3# 的帖子




1G 物理内存,2G swap,跑了个wordpress
pm = dynamic
pm.max_children = 20
pm.start_servers = 6
pm.min_spare_servers = 3
pm.max_spare_servers = 20
我修改成这种配置了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-1-19 09:13:20 | 显示全部楼层

回复 4# 的帖子


按这个设置的话应该不会,top看一下

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2016-1-19 09:58:39 | 显示全部楼层

回复 5# 的帖子


而且我感觉改了php-fpm 的这些参数后,网站变的很慢了,经常需要重启php-fpm才能瞬间打开网站,但是过了一会后,又变慢了。。。php-fpm日志是这样的
[19-Jan-2016 10:23:40] NOTICE: fpm is running, pid 31981
[19-Jan-2016 10:23:40] NOTICE: ready to handle connections
[19-Jan-2016 10:23:45] WARNING: [pool www] 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
[19-Jan-2016 10:23:46] WARNING: [pool www] 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
[19-Jan-2016 10:23:47] WARNING: [pool www] 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
[19-Jan-2016 10:23:48] WARNING: [pool www] 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
[19-Jan-2016 10:23:49] WARNING: [pool www] 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
[19-Jan-2016 10:23:50] WARNING: [pool www] server reached pm.max_children setting (25), consider raising it




这个是慢日志,已经到了刷新探针页面都卡的地步了。。。。。网站目前是测试阶段,基本上就我一个人访问。。。


[ 本帖最后由 604542720 于 2016-1-20 00:03 编辑 ]
 楼主| 发表于 2016-1-21 14:08:25 | 显示全部楼层

1


解决了,是被人攻击了xmlrpc文件,重命名这个文件就可以了,一般来说这个文件作用不大
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 21:30 , Processed in 0.026873 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表