现象: PHP查询数据库较慢,大约 60s 后 nginx 返回 504:Sorry, the page you are looking for is currently unavailable. 检查log: 从 /etc/nginx/nginx.conf 找到 /var/log/nginx/access.log 和 /var/log/nginx/error.log log 显示 upstream timed out (110: Connection timed out) while read…
执行PHP操作大文件insert mysql数据库时,出现这个错误提示 The page you are looking for is temporarily unavailable.Please try again later. set_time_limit(0)不限超时已经设置,并且PHP.INI中的错误提示已经打开,但还是出现上面的提示. 于是,查看nginx的错误日志,发现这个错误 2014/02/11 15:51:09 [error] 6085#0: *403 upstream tim…
一. 戏说不管你是做运维还是做开发,哪怕你是游客,时不时会遇到502 Bad Gateway或504 Gateway Time-out.出现这页面,把服务重启下,再实在不行重启下服务器,问题就解决了,但是,这问题还是会困扰着你,特别是做运维的人员.夜黑风高正酣睡时,一个电话响起,让你重启服务或IISRESET,肯定是极大不爽,立马要问候他妈了.呵呵,本文总结502与504故障分析与解决方法. 二. 状态码解释502 Bad Gateway:作为网关或者代理工作的服务器尝试执行请求时,从上游服务器…
客户度连接nginx超时, 建议5s内 接收客户端header超时, 默认60s, 如果60s内没有收到完整的http包头, 返回408 Syntax: client_header_timeout time; Default: client_header_timeout 60s; Context: http, server Defines a timeout for reading client request header. If a client does not transmit the…
前言:python统计apache.nginx访问日志IP访问次数并且排序(显示前20条).其实用awk+sort等命令可以实现,用awk数组也可以实现,这里只是用python尝试下. apache脚本: ips = {} with open("/root/mail_access_log-20180629") as fh: for line in fh: ip = line.split(" ")[0] if 6 < len(ip) <=15: ips…