V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
popphen
V2EX  ›  NGINX

nginx 代理 tomcat 后响应速度变慢?求大神分析

  •  
  •   popphen · 2016-09-13 12:37:37 +08:00 · 7188 次点击
    这是一个创建于 2997 天前的主题,其中的信息可能已经有所发展或是发生改变。
    nginx,配置如下
    location /tvud/ {
    proxy_pass https://172.16.100.144:9443;
    proxy_read_timeout 2000;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    client_max_body_size 20m;
    access_log logs/tvud.log main;
    error_log logs/tvud.error.lo
    如此配置后客户端从 nginx 获取一次完整的 xml 策略时间是 40 秒
    客户端直接调整到 tomcat 服务器,则访问速度是一半,18 秒-17 秒
    迷糊了
    日志参数如下:
    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for" '
    '$ssl_protocol $ssl_cipher $upstream_addr $request_time $upstream_response_time';

    日志信息如下:
    172.16.201.20 - - [13/Sep/2016:12:33:59 +0800] "POST /tvud/rd HTTP/1.0" 200 2467 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.017 0.017
    172.17.108.32 - - [13/Sep/2016:12:34:00 +0800] "POST /tvud/rd HTTP/1.0" 200 2471 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.016 0.016
    172.16.105.74 - - [13/Sep/2016:12:34:09 +0800] "POST /tvud/rd HTTP/1.0" 200 2471 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.124 0.124
    172.16.201.20 - - [13/Sep/2016:12:34:10 +0800] "POST /tvud/rd HTTP/1.0" 200 2467 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.016 0.016
    172.17.108.32 - - [13/Sep/2016:12:34:10 +0800] "POST /tvud/rd HTTP/1.0" 200 2471 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.018 0.017
    172.17.108.32 - - [13/Sep/2016:12:34:15 +0800] "POST /tvud/rd HTTP/1.0" 200 1333 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.022 0.022
    172.16.201.20 - - [13/Sep/2016:12:34:20 +0800] "POST /tvud/rd HTTP/1.0" 200 2467 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.016 0.016
    172.17.108.32 - - [13/Sep/2016:12:34:20 +0800] "POST /tvud/rd HTTP/1.0" 200 2471 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.016 0.016
    172.16.201.20 - - [13/Sep/2016:12:34:20 +0800] "POST /tvud/rd HTTP/1.0" 200 1333 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.025 0.025
    172.16.201.20 - - [13/Sep/2016:12:34:24 +0800] "POST /tvud/rd HTTP/1.0" 200 1333 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.247 0.247
    172.16.201.20 - - [13/Sep/2016:12:34:30 +0800] "POST /tvud/rd HTTP/1.0" 200 2467 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.017 0.017
    172.17.108.32 - - [13/Sep/2016:12:34:30 +0800] "POST /tvud/rd HTTP/1.0" 200 2471 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.018 0.017
    172.16.201.20 - - [13/Sep/2016:12:34:40 +0800] "POST /tvud/rd HTTP/1.0" 200 2467 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.016 0.016
    172.17.108.32 - - [13/Sep/2016:12:34:40 +0800] "POST /tvud/rd HTTP/1.0" 200 2471 "-" "TV" "-" TLSv1 ECDHE-RSA-AES256-SHA 172.16.100.144:9443 0.016 0.015
    1 条回复    2016-09-14 11:08:44 +08:00
    popphen
        1
    popphen  
    OP
       2016-09-14 11:08:44 +08:00
    顶上去,大神看到帮忙分析一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3795 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 04:17 · PVG 12:17 · LAX 20:17 · JFK 23:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.