upstream timed out (110: Connection timed out) while reading response header from upstream
Nginx报错日志有如下内容:
upstream timed out (110: Connection timed out) while reading response header from upstream..
服务器开发环境: SLES12sp2 + Nginx + PHP-FPM + Maraidb集群
请求PHP页面,浏览器一直处在加载状态,页面阻塞,没有任何反应;
网上很多资料,大意是修改nginx配置文件,延长fastcgi等待时间,但不能解决根本问题。
经测试,问题出在php-fpm,php代码要使用file存取session,读写数据库,其中有一项操作缓慢,都能造成nginx假死;
解决方案:
打开php-fpm慢日志:
mkdir /var/log/php-fpm && chown nginx:nginx /var/log/php-fpm
vi /etc/php7/fpm/php-fpm.d/www.conf
修改:
request_slowlog_timeout = 2s
request_terminate_timeout = 30s
slowlog = /var/log/php-fpm/$pool.log.slow
重启nginx和php-fpm
刷新页面,页面一直停留在阻塞状态,没有反应,这时,
tailf /var/log/php-fpm/www.log.slow
可以清楚看到执行慢的语句和操作,这样就能找到具体原因!
upstream timed out (110: Connection timed out) while reading response header from upstream的更多相关文章
- nginx 报错 upstream timed out (110: Connection timed out)解决方案
nginx 作PHP的web接口服务器. 在线上发现时不时经常崩溃.504,导致接口访问无响应回复. 查看日志: [error] 11618#0: *324911 upstream timed out ...
- 压测 502 日志报错 upstream timed out (110: Connection timed out)
环境介绍 服务器:centos6.5服务:nginx proxy 问题描述: 压测 开发同事 的开发环境项目没事,但是 线上机器 命中%50 ,大量502 php的某些页面打不开,页面提示gatewa ...
- nginx 报错 upstream timed out (110: Connection timed out)解决方案【转】
转自 nginx 报错 upstream timed out (110: Connection timed out)解决方案 - 为程序员服务http://outofmemory.cn/code-sn ...
- upstream timed out (110: Connection timed out) while reading response header from upstream, client:
遇到的问题 之前没配置下面这段,访问时候偶尔会出现 504 gateway timeout,由于偶尔出现,所以不太好排查 proxy_connect_timeout 300s;proxy_read_t ...
- Nginx报错:upstream timed out (110: Connection timed out)和client intended to send too large body【转】
nginx日志报错 2018/01/26 16:36:49 [error] 23327#0: *54953 upstream timed out (110: Connection timed out) ...
- Nginx Upstream timed out (110: Connection timed out)
Nginx Upstream timed out (110: Connection timed out) – 运维生存时间 http://www.ttlsa.com/nginx/nginx-upstr ...
- nginx 超时问题: upstream timed out (110: Connection timed out) while reading response header from upstream
目录 错误内容 错误原因 错误解决办法 错误内容 我们可以在error.log 里面可以看到 错误内容:upstream timed out (110: Connection timed out) w ...
- xdebug 一直报错 upstream timed out (110: Connection timed out) while reading response header from upstream
本地主机(Windows环境192.168.66.1)访问虚拟机(192.168.66.139)里面的搭建的php环境(系统centos6.5版本,php版本是5.5.30 ,xdebug 2.4.0 ...
- 解决flask的502错误:upstream prematurely closed connection while reading response header from upstream
我在使用 tiangolo/uwsgi-nginx-flask 部署flask应用的时候,经常运行一会儿就出现502错误,重新启动容器后,就恢复. 且经常会出现数据更新后,刷新结果不一致. docke ...
随机推荐
- 浅谈table、form 标签
1.<table> 标签 1.1包含的元素 <caption></caption>:表头信息. <tr></tr> :定义一个表格行: &l ...
- JDK安装教程(Windows7 x64)
1.下载JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 选择自己系统相对 ...
- prefix super supra sex sept septi out~2
1★ super 2★ supra 超过,超出 3★ sept 4★ septi 7 5★ sex 6
- Utf-8+Bom编码导致的读取数据部分异常问题
项目中经常会有这种场景,在配置文件中配置对应关系,项目启动的时候从中读取数据存入map缓存起来,这样使用的时候就可以直接从map找到对应的映射关系. 然后遇到了这么一个诡异的问题,一个简单的映射关系如 ...
- 【1】windows下IOS开发基础环境搭建
一.目的 本文的目的是windows下IOS开发基础环境搭建做了对应的介绍,大家可根据文档步骤进行mac环境部署: 二.安装虚拟机 下载虚拟机安装文件绿色版,点击如下文件安装 获取安装包: ...
- centos6.5 安装PHP7.0支持nginx
1.安装PHP所需要的扩展 yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel ...
- 20 KMP匹配的Next值和Nextval值
i 0 1 2 3 4 5 6 7 8 s a b a b a a b a b n ...
- pyhton字符串
a = 5 # 1 + 1 = 10 + 1 = 11 + 1 = 100 + 1 = 101print(a.bit_length()) # 计算一个数字的二进制长度. a = 10# print(t ...
- 开发框架DevExtreme全新发布v18.2.6|附下载
DevExtreme Complete Subscription是性能最优的 HTML5,CSS 和 JavaScript 移动.Web开发框架,可以直接在Visual Studio集成开发环境,构建 ...
- exists 的使用
SELECT u.login_id, ( from mdp_user_login_info muli where muli.BIZ_SYS = 'admin' and u.login_id=muli. ...