nginx nginx502状态 && nginx log recv() failed (104: Connection reset by peer)

不念不忘少年蓝@ 2022-05-17 09:20 337阅读 0赞
      • 场景
      • 分析
      • 解决

场景

  • 在长耗时导出文件的时候 , 502错误; 分析nginx.log
  1. * `2018/08/09 14:27:12 [error] 29081#0: *9113790 recv() failed (104: Connection reset by peer) while reading response header from upstream, client:`

分析

  • 因为发现错误时在测试部门, 所以首先排除了代码的原因
  • 导致502的原因很多,所以需要分析nginx log, 但是比较常见的是 ‘处理超时’

解决

  • 测试部分(一台新机器)php-fpm的配置 request_terminate_timeout=60; 很明显不能满足导出文件的需要的时间
  1. * php-fpm.conf `request_terminate_timeout=0`
  2. * sudo kiill -USR2 php-fpm(matser process)

发表评论

表情:
评论列表 (有 0 条评论,337人围观)

还没有评论,来说两句吧...

相关阅读