公司,测试环境.windows+Nginx+tomcat
下午,准备打开测试环境工作时,发现nginx出现502 bad gateway错误.按常理,我怀疑是后端的tomcat故障了.于是决定重启tomcat.但未果.直接打开TOMCAT的8080端口,是可以正常访问JAVA页面的.奇怪了.
502肯定是后端的问题呀.接着,打开NGINX错误日志,发现问题:
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
原来是TCPIC资源用完了.
于是GOOGLE,找到"试图从大于 5000 的 TCP 端口连接时收到错误"这篇文章:http://support.microsoft.com/kb/196271
- 启动注册表编辑器。
- 在注册表中,找到下面的子项,然后单击 参数:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
- 在 编辑 菜单上单击 新建,然后添加以下注册表项:
值名称: MaxUserPort
值类型: DWORD
值数据: 65534
有效范围: 5000-65534 (十进制)
默认值: 0x1388 (5000 十进制)
修改了注册表,但需要重启.因为其它同事正在使用机器,无法马上重启.所以,未知是否能修复此问题.
更新:成功了.
---
更新 120521
今天又出现类似问题:
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
===
(10055)
No buffer space available.
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
你是怎么彻底解决这个问题的?我现在除了重启apache服务器,别无他法。
我也还没完全能解决啊.