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的更多相关文章

  1. nginx 报错 upstream timed out (110: Connection timed out)解决方案

    nginx 作PHP的web接口服务器. 在线上发现时不时经常崩溃.504,导致接口访问无响应回复. 查看日志: [error] 11618#0: *324911 upstream timed out ...

  2. 压测 502 日志报错 upstream timed out (110: Connection timed out)

    环境介绍 服务器:centos6.5服务:nginx proxy 问题描述: 压测 开发同事 的开发环境项目没事,但是 线上机器 命中%50 ,大量502 php的某些页面打不开,页面提示gatewa ...

  3. nginx 报错 upstream timed out (110: Connection timed out)解决方案【转】

    转自 nginx 报错 upstream timed out (110: Connection timed out)解决方案 - 为程序员服务http://outofmemory.cn/code-sn ...

  4. upstream timed out (110: Connection timed out) while reading response header from upstream, client:

    遇到的问题 之前没配置下面这段,访问时候偶尔会出现 504 gateway timeout,由于偶尔出现,所以不太好排查 proxy_connect_timeout 300s;proxy_read_t ...

  5. 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) ...

  6. Nginx Upstream timed out (110: Connection timed out)

    Nginx Upstream timed out (110: Connection timed out) – 运维生存时间 http://www.ttlsa.com/nginx/nginx-upstr ...

  7. nginx 超时问题: upstream timed out (110: Connection timed out) while reading response header from upstream

    目录 错误内容 错误原因 错误解决办法 错误内容 我们可以在error.log 里面可以看到 错误内容:upstream timed out (110: Connection timed out) w ...

  8. 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 ...

  9. 解决flask的502错误:upstream prematurely closed connection while reading response header from upstream

    我在使用 tiangolo/uwsgi-nginx-flask 部署flask应用的时候,经常运行一会儿就出现502错误,重新启动容器后,就恢复. 且经常会出现数据更新后,刷新结果不一致. docke ...

随机推荐

  1. nginx反向代理配置相对路径

    需求: 在公司内部搭建了一个php的网站,想用花生壳映射到外网. 一.反向代理解决直接映射不成功问题 直接用把花生壳的"域名+端口"指向此php网站并竟然不生效.但是不加网站名可以 ...

  2. SpringBoot鸡汤(注解集合)

    1.(ConfigBean.java :是一个带有属性的bean类) @Configuration @ConfigurationProperties(prefix = “com.md”) @Prope ...

  3. 基本git指令

    --git包含命令行界面和图形化界面 1.Git安装之后需要进行一些基本信息设置 a.设置用户名:git  config -- global  user.name  '你再github上注册的用户名' ...

  4. Matlab远程调试 转

        Matlab的调试总体分为,直接调试和间接调试.1.直接调试:(1)去掉句末的分号:(2)单独调试一个函数:将第一行的函数声明注释掉,并定义输入量,以脚本方式执行 M 文件:(3)适当地方添加 ...

  5. socket简述-------转载

    “一切皆Socket!” 话虽些许夸张,但是事实也是,现在的网络编程几乎都是用的socket. ——有感于实际编程和开源项目研究. 我们深谙信息交流的价值,那网络中进程之间如何通信,如我们每天打开浏览 ...

  6. java的小程序在html中的运行测试

    java的小程序在html中的运行测试,打开vs2012,以网站模式打开,生成,调用iis临时服务器运行.

  7. unity中手机触摸代码

    #elif UNITY_IOS || UNITY_ANDROID         if(Input.touchCount <= 0)         {             return;/ ...

  8. HTML中元素的position属性详解

    HTML中元素的position属性详解 转载自:https://blog.csdn.net/wangzunkuan/article/details/81540935   HTML中DOM元素有5种定 ...

  9. Linux十字病毒查杀处理

    之前处理过一次十字病毒,但未好好整理处理过程,现在转载一篇来自51cto的文章. 转自:http://blog.51cto.com/ixdba/2163018 十字符病毒,杀不死的小强,一次云服务器沦 ...

  10. weblogic部署web项目(war包)

    第一步,启动并访问weblogic,进入登录页面 第二步,进入主页面,开始部署项目 第三步,上载项目war包 选择需要上载的本地war包 第四步,开始项目配置 继续下一步 选择红色标记的配置 第五步, ...