惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
V
Visual Studio Blog
P
Privacy International News Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
T
Threatpost
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
小众软件
小众软件
L
LINUX DO - 最新话题
C
Cisco Blogs
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
罗磊的独立博客
V
V2EX
博客园 - Franky
P
Proofpoint News Feed
SecWiki News
SecWiki News
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - 迷

如何升级一台老macbook air的macOS到最新版本 IDEA错误的忽略了智能补全代码,导致正确的代码自动提示不出来的问题 校准liunx时间简单好用的命令 服务器安装Ubuntu的那些坑 闭包的应用案例 Activiti 乱码问题 Activiti 整合的小插曲 IDEA 提示找不到 javax 等 tomcat 的相关包 一些好用的 Oracle 批处理和语句 Oracle 日志报错导致的 “没有登录” 问题 WebPack 从安装到闲置 Android Studio 编译提示 No installed build tools found. Please install the Android build tools VBox 安装 Ubuntu Server 的那些坑,键盘乱码、网卡互连、共享目录等 产品是什么? 如何管理? 如何远程工作? 远程工作的手段 PhoneGap 3.4 开发配置及问题 错误:找不到或无法加载主类
nginx 的 upstream timed out 问题
· 2017-02-15 · via 博客园 - 迷

2017-02-15 15:30    阅读(19777)  评论()    收藏  举报

nginx 作为负载服务,表现为网站访问很慢,有些文件或页面要等待到60s才会返回,我注意到60s就是超时时间,但是超时后返回状态是正常值200,网站可以正常打开,就是会一直等待到超时才打开,而且问题出现不定时,不定文件,静态文件也会出现这个问题。貌似很奇葩是吧,最终查看错误信息没有注意到 IPv6,导致饶了不少弯。

错误信息:

[error] 5292#5912: *3059 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 66.249.69.219, server: xxx.com, request: "GET /shop/view.jhtml HTTP/1.1", upstream: "http://[::1]:12002/shop/view.jhtml", host: "www.xxx.com"

配置如下:

    upstream zcun_pool {
        server localhost:12001 max_fails=1 fail_timeout=30s;
        server localhost:12002 max_fails=1 fail_timeout=30s;
        server localhost:12003 max_fails=1 fail_timeout=30s;
    }

发现可能是 IPv6 的问题后,改 localhost 为本地 IPv4 即可解决.....这错误说起来还真是低级~

    upstream zcun_pool {
        server 127.0.0.1:12001 max_fails=1 fail_timeout=30s;
        server 127.0.0.1:12002 max_fails=1 fail_timeout=30s;
        server 127.0.0.1:12003 max_fails=1 fail_timeout=30s;
    }

网站访问回复正常。