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

2016-09-13 12:37:37 +08:00
 popphen
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
7183 次点击
所在节点    NGINX
1 条回复
popphen
2016-09-14 11:08:44 +08:00
顶上去,大神看到帮忙分析一下

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

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

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

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

© 2021 V2EX