nginx 请求后端服务,频繁卡 1 分钟

2019-08-16 16:31:49 +08:00
 a1392136

前端或 postman 调用 nginx 代理的后端接口,会频繁的卡一分钟( 1m 0.16s ,正常请求 100ms 左右)。

服务端是在 100ms 左右就处理完成,并返回了响应日志,直接请求后端接口也是正常的 100ms

nginx 配置:

#user nobody; worker_processes 4;

events { use epoll; worker_connections 65535; }

http { include mime.types; default_type application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

underscores_in_headers on;

keepalive_timeout  180;

#gzip  on;
include cnf/upstream_*.cnf;
server {
    listen       80;
    server_name  localhost;
    include cnf/pathrule.cnf;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   html;
        index  index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

}

}

1424 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/592506

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX