HTTPS与HTTP速度比较 [英] HTTPS vs HTTP speed comparison

查看:775
本文介绍了HTTPS与HTTP速度比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个受到越来越多关注的热门问题。为了阻止错误信息的传播,请首先阅读以下段落和随附的文章:

速度不应成为决定是否使用HTTPS的因素或HTTP。如果您需要 HTTPS 您网站的任何部分(登录,注册,信用卡等),您绝对需要所有这些的 ,所有的时间。

Speed should not be a factor in deciding whether to use HTTPS or HTTP. If you need HTTPS for any part of your site (log-ins, registration, credit cards, etc), you absolutely need HTTPS for all of it, all the time.

请阅读 SSL不是关于加密 Troy Hunt 原因。

我被认为是在https下运行我的整个电子商务网站。我决定运行一个粗略的基准来测量156KB图像的下载时间,通过https vs http,因为我已经读过https负担加密过程中的额外开销。

I'm considered running my entire e-commerce website under https. I decided to run a crude benchmark to measure the download time of a 156KB image through https vs http because I had read that https is burdened with additional overhead from the encryption process.

使用Firefox的Firebug进行基准测试,只需在从空缓存下载图像时,从Net面板将等待和接收时间(所有其他时间均为0)转录到Excel。

Benchmark was performed using Firefox's Firebug simply by transcribing the "Waiting" and "Receiving" times (all other times are 0) to Excel from the Net panel when downloading the image from an empty cache.

我的结果出乎意料:

http: 11.233 seconds
Waiting     Receiving   Total 
1.56        0.88        2.44 
1.55        0.101       1.651 
1.53        0.9         2.43 
1.71        0.172       1.882 
1.9         0.93        2.83 

https: 9.936 seconds
Waiting     Receiving  Total
0.867       1.59       2.457
0.4         1.67       2.07
0.277       1.5        1.777
0.536       1.29       1.826
0.256       1.55       1.806

[明显]来自基准的观察:

[Obvious] Observations from benchmark:


  • 服务器响应速度更快,但https的下载时间比http慢。

  • https整体上更快(~10%)。


有谁可以解释为什么会发生这种情况?

你认为文件(html,css,javascript)会给出不同的结果吗?

有没有人有更好的方法基准测试下载?









这是测试图片:

Can anyone explain why this would happen?
Do you think a document (html,css,javascript) will give different results?
Does anyone have a better method of benchmarking downloads?





Here is the test image:

[测试图片已删除]

[test image removed]

其他信息:


  • 该网站位于Godaddy.com的共享主机帐户上。

  • 如果您打算如此善良,可以自行运营基准测试不添加www子域...无论如何我使用root作为静态内容。

  • 在集成管道模式下使用IIS7。

编辑:1px GIF的基准(35字节)以下:

http: 2.666 seconds
Waiting     Receiving  Total
0.122       0.31       0.432
0.184       0.34       0.524
0.122       0.36       0.482
0.122       0.34       0.462
0.126       0.64       0.766


https: 2.604 seconds
Waiting     Receiving  Total
0.25        0.34       0.59
0.118       0.34       0.458
0.12        0.34       0.46
0.182       0.31       0.492
0.134       0.47       0.604

结果:
https仍然更快;虽然在这种情况下很简单。

Results: https is still faster; though trivially in this case.

如果有人在我的基准测试中发现了一个漏洞让我知道,那么我可以发布更好的结果。

If anyone sees a flaw in my benchmark let me know so I can post better results.

因此,Godaddy在下午6点左右共享托管,我的特定服务器内容通过https服务比http更快。

So, on Godaddy shared hosting at around 6:00pm on my specific server content served over https is faster than over http.

推荐答案

如果你看一下你的时间,http有更长的等待时间和更短的接收时间。另一方面,https具有较小的等待时间和较长的接收时间。我会解释这一点,因为共享主机服务器上的http端口更繁忙,因此请求在队列中保持更长时间,直到服务器接受为止。一旦被接受,请求的传输速度将快于https。在https端口上,服务器上的流量较少,因此请求的服务速度更快,但传输时间更长。

If you look at your times http has bigger waiting time and smaller receiving time. https on the other hand has smaller waiting time and bigger receiving time. I would interpret this as the http port on the shared hosting server is more busy, thus a request stays longer in the queue until is accepted by the server. Once accepted, the requests is transferred faster than https. On the https port there is less traffic on the server so the request is serviced faster but takes longer to transfer.

对于任何https与http比较,您必须考虑到与http相比,握手每个https请求的时间更长。在做很多小请求时你会看到恶化。

For any https vs. http comparison you'll have to take into account the bigger time to handshake each request for https compared with http. You should see worsening when doing many small requests.

这篇关于HTTPS与HTTP速度比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆