nginx做负载后为什么超级慢
1个回答
2016-06-22
展开全部
upstream local {
server localhost:8080;
server localhost:8081;
}
server {
listen 80;
server_name localhost;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|html)$ {
expires 30d;
}
location ~ ^/(WEB-INF)/ {
deny all;
}
location / {
proxy_pass http://local;
}
}
然后打开localhost,间歇性的非常卡,10秒都加载不出来页面。
错误日志里有这些记录,请问这问题该怎么解决?
2014/12/31 06:10:45 [error] 3204#688: *4 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: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://[::1]:8081/", host: "localhost"
2014/12/31 06:10:45 [error] 3204#688: *4 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: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://[::1]:8081/", host: "localhost"
server localhost:8080;
server localhost:8081;
}
server {
listen 80;
server_name localhost;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|html)$ {
expires 30d;
}
location ~ ^/(WEB-INF)/ {
deny all;
}
location / {
proxy_pass http://local;
}
}
然后打开localhost,间歇性的非常卡,10秒都加载不出来页面。
错误日志里有这些记录,请问这问题该怎么解决?
2014/12/31 06:10:45 [error] 3204#688: *4 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: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://[::1]:8081/", host: "localhost"
2014/12/31 06:10:45 [error] 3204#688: *4 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: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://[::1]:8081/", host: "localhost"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |