wHTTP重用现存连接来减少TCP建立时延。

HTTP The Definitive Guide

4.2.3 TCP Connection Handshake Delays

When you set up a new TCP connection, even before you send any data, the TCP software exchanges
a series of IP packets to negotiate the terms of the connection (see Figure 4-8). These exchanges can
significantly degrade HTTP performance if the connections are used for small data transfers.

Here are the steps in the TCP connection handshake:
1.

To request a new TCP connection, the client sends a small TCP packet (usually 40-60 bytes)
to the server. The packet has a special "SYN" flag set, which means it's a connection request.
This is shown in Figure 4-8a.
2.

If the server accepts the connection, it computes some connection parameters and sends a
TCP packet back to the client, with both the "SYN" and "ACK" flags set, indicating that the
connection request is accepted (see Figure 4-8b).

3.

Finally, the client sends an acknowledgment back to the server, letting it know that the
connection was established successfully (see Figure 4-8c). Modern TCP stacks let the client
send data in this acknowledgment packet.
The HTTP programmer never sees these packets—they are managed invisibly by the TCP/IP
software. All the HTTP programmer sees is a delay when creating a new TCP connection.
The SYN/SYN+ACK handshake (Figure 4-8a and b) creates a measurable delay when HTTP
transactions do not exchange much data, as is commonly the case. The TCP connect ACK packet
(Figure 4-8c) often is large enough to carry the entire HTTP request message,
[4]
and many HTTP
server response messages fit into a single IP packet (e.g., when the response is a small HTML file of a
decorative graphic, or a 304 Not Modified response to a browser cache request).
[4]
IP packets are usually a few hundred bytes for Internet traffic and around 1,500 bytes for local traffic.
The end result is that small HTTP transactions may spend 50% or more of their time doing TCP setup.
Later sections will discuss how HTTP allows reuse of existing connections to eliminate the impact of
this TCP setup delay.

最新文章

  1. 小Q系列之 最佳裁判
  2. 浅谈inline-block
  3. sigaction
  4. Android 使用ViewPager实现左右循环滑动图片
  5. 北京大学Cousera学习笔记--1-学习规划
  6. mysql数据库优化(一)
  7. 540. Single Element in a Sorted Array
  8. shop++之language
  9. CentOS7+Apache+MySQL+PHP环境
  10. Python 字典(Dictionary) values()方法
  11. 8F - 采矿
  12. Android拦截外拨电话
  13. 下载RAD
  14. macbook 蓝牙关闭按钮灰色的
  15. Qt532__std::numeric_limits<qint64>::min();
  16. [SoapUI] 如何让gzip和chunked的response显示出来 [设置Accept-Encoding为deflate]
  17. 深入CSS属性(九):z-index
  18. Python基础之文件处理、函数、内置函数 (三)
  19. 【读书笔记】《深入浅出nodejs》第五章 内存控制
  20. 【剑指offer】左旋转字符串,C+实现

热门文章

  1. struts2内置拦截器和自定义拦截器详解(附源码)
  2. rip中的连续子网以及不连续子网
  3. C# TextBox常用方法总结
  4. 基于HTML5自定义文字背景生成QQ签名档
  5. select下拉选框的默认值,包括每次进入页面的默认值
  6. gpio 灯的对应关系
  7. Docker Swarm学习教程
  8. php -- 魔术方法 之 序列化和反序列化的触发函数:__sleep(),__wakeup()
  9. git 怎么看某个commit 修改的代码
  10. 动态向SqlParameter 里添加相应参数