场景:为了得到用户在线等实时信息,在客户端做了个ajax轮训,每隔5秒请求一次;
用户量一上来,于是问题就来了,页面各种卡nginx日志文件
[root@iZt web]# tail -f /data/log/nginx_error.log
2017/06/16 19:20:28 [error] 230555#0: *10228041 recv() failed (104: Connection reset by peer)
while reading response header from upstream,client: 42.19.1.114, server: 47.18.212.1, request:
"POST /api-chat/subshade?rnd=880 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000",host: "www.1j008.com", referrer: "http://www.2008.com/6166"
.......狂刷此错误
php日志文件
[root@iZt web]# tail -f /data/log/php-fpm.log
[19-Jun-2017 10:51:05] WARNING: [pool www] child 754153 exited on signal 11 (SIGSEGV) after 74.433547 seconds from start
[19-Jun-2017 10:51:05] NOTICE: [pool www] child 755405 started
.......狂刷此错误  百度谷歌后分析结果,大意如下几点:
1.  php程序执行时间超过php-fpm.conf 中 request_terminate_timeout = 300;设置的值,然后php-fpm进程立即退出,此时nginx得不到php-fpm进程的正确结果,响应502
解决方法: 改request_terminate_timeout 0;不限制超时   2. php-fpm进程数量来不及处理。
解决方法: 增大php-fpm进程数 3. 因为每个php-fpm在处理一定数量请求后自动stop,然后create new php-fpm
解决方法: 改pm.max_requests限制.....
对应一下我的日志看来,网上的症状确实与我的同出一辙。
窃喜.....没多久发现不对,对应着改了一轮下来,各种服务重启, 问题依旧、 好;既然无果那么就分析一下php-fpm疯狂的终止原因[root@iZt web]#dmesg
......
php-fpm[744779]: segfault at 1c ip 00000000007a8ea1 sp 00007ffe40af5330 error 4 in php-fpm[400000+9a9000]
php-fpm[744924]: segfault at 10bc890 ip 000000000078931f sp 00007ffe40af56e8 error 4 in php-fpm[400000+9a9000]
php-fpm[746677]: segfault at 1c ip 00000000007a8ea1 sp 00007ffe40af5330 error 4 in php-fpm[400000+9a9000]
php-fpm[746738]: segfault at 0 ip 00000000007a8ead sp 00007ffe40af5330 error 6 in php-fpm[400000+9a9000]
php-fpm[746371] general protection ip:7a8ead sp:7ffe40af5330 error:0 in php-fpm[400000+9a9000]好了,问题找到
在php里面我确实处理过客户端ip  类似$_SERVER['REMOVE_ADDR']方法得到的ip
经过ip2long ( string $ip_address )转换时出错, 因为 $ip_address = "这里的ip不合符规则里面有逗号"过滤之....
安静了

转载于:https://www.cnblogs.com/sixiong/p/7048135.html

recv() failed (104: Connection reset by peer) while reading response header from upstream相关推荐

  1. nginx php 104,记一次nginx 502排错经历:recv() failed (104: Connection reset by peer)

    开发了一个新项目,开发环境完全正常,部署至测试环境时,直接报502,换了几台测试机器,有正常的也有依然报502的-- 环境 开发.测试.生产环境均是CentOS 6.8的系统,Web环境是nginx+ ...

  2. nginx php 104,Nginx错误:recv() failed (104: Connection reset by peer) whi

    Nginx错误:recv() failed (104: Connection reset by peer) while reading response header from upstream PH ...

  3. [Python] ConnectionResetError: [Errno 104] Connection reset by peer

    python socket 编程,sftp远程读日志文件,取最后的30行返回.收到ConnectionResetError: [Errno 104] Connection reset by peer报 ...

  4. python httplib [Errno 104] Connection reset by peer问题

    写了一个简单的http client 方法,代码如下 import httplib import json from common.logger import sys_loggerdef http_r ...

  5. (20200921 Solved)ConnectionResetError: [Errno 104] Connection reset by peer

    问题描述 用Python连接docker容器中的Redis 预备知识 [Errno 104] Connection reset by peer errno 104表示对一个对端socket已经关闭的连 ...

  6. <urlopen error [Errno 104] Connection reset by peer>

    使用python写一个脚本调用接口时,报了这个错,在"urllib.request.urlopen(req, context=context)"这个方法中报错. 错误原因 发送的r ...

  7. python [Errno socket error] [Errno 104] Connection reset by peer

    python [Errno socket error] [Errno 104] Connection reset by peer 原因可能是多方面的,不过更常见的原因是: ①:服务器的并发连接数超过了 ...

  8. ConnectionResetError: [Errno 104] Connection reset by peer

    Python代码使用循环发起网络请求,发起单个没有问题,发起多个请求,就会报错 ConnectionResetError: [Errno 104] Connection reset by peer 可 ...

  9. nginx响应超时upstream timed out (110: Connection timed out) while reading response header from upstream

    问题描述 解决方法 提高nginx网络吞吐量buffers优化指令说明 nginx代理超时配置 nginx缓存区大小设置 问题描述 后台server服务响应时间正常,但是请求没有打到服务器,在ngin ...

最新文章

  1. python 时间模块备忘
  2. python使用教程pandas-「Python」pandas入门教程
  3. java===Runtime类
  4. 激怒开源社区,微软悄悄删除2500行功能代码后致歉:已恢复!
  5. web访问负载均衡的实现
  6. php 图片单位转换,php如何把图片转换成二进制字符串
  7. mssql如何取得两位的月份和天数
  8. 计算机动画专业哪个大学排名,哪些大学院校数字媒体艺术、动画专业比较排名...
  9. Java千百问局部变量、类变量、实例变量有什么区别
  10. 漫谈 Clustering (4): Spectral Clustering
  11. POJ训练计划3096_Surprising Strings(STL/map)
  12. 计算机桌面文件自动备份取消,电脑如何取消自动备份_电脑怎么取消自动备份...
  13. CVPR2019 | 论文分类汇总
  14. 软件测试行业发展现状及前景
  15. 实现多余文字显示省略号
  16. 对《人工智能的进化》这一人工智能方面科普书籍的学习/摘抄/总结
  17. 大学三年来的心路历程分享
  18. 简单网页版的年会抽奖程序,设计个界面套上就可以了,抽奖员工编号姓名改改代码就可以了,很简单的
  19. 64位Windows10+Code::Blocks+CUDA安装教程
  20. 2020年七普各城市人口年龄结构图

热门文章

  1. 磨金石教育|干货分享:剪辑技法之跳切(上)
  2. zigbee期末考试选择题含答案
  3. sql查询两张表中不同的数据
  4. 主动变被动9个例句_语法知识:被动语态怎么用,你知道吗?
  5. 东野圭吾:把杀人凶手绑在这种虚无的十字架上,到底有什么意义?
  6. Origin中使用CopyPage复制图片到Word后比例失调解决办法
  7. inode网卡被禁用解决方法
  8. Cocos2d-x 的“HelloLua” 深入分析
  9. 微信之父张小龙:怎样做简单的产品经理?
  10. 跨境平台到底好不好?跨境电商分析