HTTP/S请求之上的网络开销的流量百分比是多少 [英] What % of traffic is network overhead on top of HTTP/S requests

查看:547
本文介绍了HTTP/S请求之上的网络开销的流量百分比是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们:
1)在网络适配器级别(通过NIC的原始位数)计算字节/位,并且
2)计算所有HTTP/S请求/响应中的字节数.

If we:
1) Count bytes/bits at the network adapter level (raw # of bits through the NIC) and,
2) Count bytes in all HTTP/S request/responses.

假设只显示HTTP/S流量,并假设典型"网络流量在统计上是相关的:

Assuming only HTTP/S traffic is on the box, and assuming a statistically relevant amount of "typical" web traffic:

我想知道由于额外的网络开销,在NIC级别比在HTTP/S级别计算更多的流量(计算HTTP标头和全部).

I want to know about how much more traffic will be counted at the NIC level than at the HTTP/S level (counting http headers and all) because of the extra network overhead.

推荐答案

您对HTTP之下的各层的了解为零.您甚至无法假设HTTP请求将通过TCP/IP传递.即使是这样,您对网络层增加的开销的了解也为零.或者,路由的可靠性将是什么,以及由于丢包/重发包而造成的开销.

You have zero knowledge about the layers below HTTP. You can't even assume the HTTP request will be delivered over TCP/IP. Even if it is, you have zero knowledge about the overhead added by the network layer. Or what the reliability of the route will be and what overhead will be due to dropped/resent packets.

更新:根据您的评论,这里有一些不合常规的估计:

Update: Based on your comment, here are some back-of-the-napkin estimates:

通常会协商最大段大小(不包括TCP或IP标头)在各层之间减去 MTU 的大小减去标题大小.对于以太网,MTU通常配置为1500字节. TCP标头为160位,即20个字节. IPv4标头的固定部分为160位,也为20个字节. IPv6标头的固定部分为320位或40个字节.因此:

The maximum segment size (which does not include the TCP or IP headers) is typically negotiated between the layers to the size of the MTU minus the headers size. For Ethernet MTU is usually configured at 1500 bytes. The TCP header is 160 bits, or 20 bytes. The fixed part of the IPv4 header is 160 bits, or 20 bytes as well. The fixed part of the IPv6 header is 320 bits, or 40 bytes. Thus:

  • 用于基于TCP/IPv4的HTTP

开销= TCP + IP = 40字节

overhead = TCP + IP = 40 bytes

有效载荷= 1500-40 = 1460字节

payload = 1500 - 40 = 1460 bytes

间接费用%= 2%(40 * 100/1460)

overhead % = 2% (40 * 100 / 1460)

  • 用于基于TCP/IPv6的HTTP

开销= TCP + IP = 60字节

overhead = TCP + IP = 60 bytes

有效载荷= 1500-60 = 1440字节

payload = 1500 - 60 = 1440 bytes

间接费用%= 4%(60 * 100/1440)

overhead % = 4% (60 * 100 / 1440)

以下是假设:

  • Amazon计算不带以太网头(而不是整个NIC数据包)的NIC有效负载
  • 您的HTTP响应已充分利用TCP/IP数据包-您的典型页面大小+ HTTP标头会导致一个或多个完整的TCP/IP数据包,而一个具有超过50%的有效负载
  • 您在缓存的内容上设置了明确的到期日期,以最大程度地减少302响应
  • 您避免重定向或您的URL足够长以填充有效载荷

这篇关于HTTP/S请求之上的网络开销的流量百分比是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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