Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
nginx:http2在“客户端从服务器接收应用程序数据”步骤中消耗的时间比https多`_Nginx_Https_Http2 - Fatal编程技术网

nginx:http2在“客户端从服务器接收应用程序数据”步骤中消耗的时间比https多`

nginx:http2在“客户端从服务器接收应用程序数据”步骤中消耗的时间比https多`,nginx,https,http2,Nginx,Https,Http2,我非常关心HTTPS和HTTP/2之间的性能差异 我非常关心连接过程中每一步所消耗的时间 包括TCP握手SSL握手和客户端发送的应用程序数据客户端接收的应用程序数据 我做了个测试 使用Nginx服务器,设置端口440:ssl,和端口442:sslhttp2 关闭ssl\u会话\u缓存和ssl\u会话\u票据,然后每个请求都将处理TCP握手和ssl握手 // https url : ssl_session_cache off; ssl_session_tickets off; https

我非常关心HTTPS和HTTP/2之间的性能差异

我非常关心连接过程中每一步所消耗的时间

包括
TCP握手
SSL握手
客户端发送的应用程序数据
客户端接收的应用程序数据

我做了个测试

使用Nginx服务器,设置
端口440
ssl
,和
端口442
sslhttp2

关闭
ssl\u会话\u缓存
ssl\u会话\u票据
,然后每个请求都将处理
TCP握手
ssl握手

// https url   :   ssl_session_cache off;  ssl_session_tickets off;
https://www.example.com:440/index.html


// http/2 url  :   ssl_session_cache off;  ssl_session_tickets off;
https://www.example.com:442/index.html
最后,我用
okhttp3.8.1
从一个android应用程序启动了两个超过1000次的URL。 已添加每个请求头
连接:关闭

同时,使用Wireshark捕获数据包

统计结果出乎意料

在客户端从服务器接收应用程序数据的步骤中,HTTP/2比HTTPS消耗更多的时间

为什么??我很困惑。我错了吗?有什么想法吗???谢谢你

统计结果(时间:ms)

https.url.and.http2.url

nginx.conf

[root@iZ941gs04jwZ~]#nginx-V
nginx版本:nginx/1.12.0
根据gcc 4.8.5 20150623(红帽4.8.5-11)(gcc)建造
使用OpenSSL 1.0.2l构建2017年5月25日
已启用TLS SNI支持
配置参数:--prefix=/usr/local/webserver/nginx--with-http_stub_status_module--with-http_ssl_module--with-pcre=/root/tmp/pcre-8.35--with-http_v2_module--with-openssl=../openssl-1.0.2l


比较的是HTTP/1.1和HTTP/2,两者都使用HTTPS!更重要的是,我想说你比较了nginx+okHTTP的HTTP/1.1和HTTP/2的实现……是的,还有什么意义呢?你的问题没有这么说,这听起来像是你比较了HTTPS和HTTP/2……实际上是“比较HTTPS和HTTP/2”。比较的是HTTP/1.1和HTTP/2,两者都使用HTTPS!更重要的是,我想说,你比较了nginx+okHTTP的HTTP/1.1和HTTP/2实现……是的,还有什么意义?你的问题没有这么说,这听起来像是你将HTTPS与HTTP/2进行了比较……实际上是“将HTTPS与HTTP/2进行比较”。