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.

TCP requires two packet transfers to set up the connection before it can send data的更多相关文章

  1. CC3200在AP模式的TCP sock作为客户端连接时返回SL_ECONNREFUSED(-111) Connection refused

    1. CC3200处于AP模式(电脑无线连接CC3200的WIFI信号),开启一个TCP socket,这个socket作为TCP客户端去连接TCP服务器端 struct sockaddr_in ad ...

  2. jmeter压测tcp协议接口:java.net.SocketException: Software caused connection abort: socket write error

    tcp接口,试压过程中,部分请求报如下错误: java.net.SocketException: Software caused connection abort: socket write erro ...

  3. Mini2440 DM9000 驱动分析(一)

    Mini2440 DM9000 驱动分析(一) 硬件特性 Mini2440开发板上DM9000的电气连接和Mach-mini2440.c文件的关系: PW_RST 连接到复位按键,复位按键按下,低电平 ...

  4. Linux skbuff注释笔记

    SKB结构定义   /usr/src/linux/include/linux/skbuff.h sk_buff_head: struct sk_buff_head { //SKB的头结点 /* The ...

  5. commit Commit changes to stable storage 对变化提交

    Python36\site-packages\pymysql\connections.py # Python implementation of the MySQL client-server pro ...

  6. https://github.com/PyMySQL/PyMySQL/blob/master/pymysql/connections.py

    # Python implementation of the MySQL client-server protocol # http://dev.mysql.com/doc/internals/en/ ...

  7. python之I/O多路复用

         python  IO多路复用 一.多路复用概念: 监听多个描述符(文件描述符(windows下暂不支持).网络描述符)的状态,如果描述符状态改变 则会被内核修改标志位,进而被进程获取进而进行 ...

  8. 推荐一个比FiddlerCore好用的HTTP(S)代理服务器

    为什么不用FiddlerCore? 说到FiddlerCore大家可能会比较陌生,那么它哥Fiddler就比较熟悉了:抓包.模拟低带宽.修改请求我平时比较常用.Fiddler的本质就是一个HTTP代理 ...

  9. 最简单的基于librtmp的示例:发布(FLV通过RTMP发布)

    ===================================================== 最简单的基于libRTMP的示例系列文章列表: 最简单的基于librtmp的示例:接收(RT ...

随机推荐

  1. 【C语言】20-static和extern关键字2-对变量的作用

    一.在Java中,全局变量的定义没有严格的位置规定 全局变量可以定义在类的最前面,也可以定义在类的最尾端,也就说一个方法可以访问在它之后定义的变量. 可以看到,第4行定义的test方法可以访问第8行定 ...

  2. Secure REST API with oauth2 (翻译)

    http://blog.csdn.net/haiyan_qi/article/details/52384734 ******************************************** ...

  3. Python 内置模块函数filter reduce

    1.filter()实现过滤的功能 2.reduce()对序列中元素的连续操作可以通过循环来处理 3.map()对tuple元组进行解包操作,调用时设置map()的第一个参数为None 4.使用red ...

  4. Python处理文件以及文件夹常用方法

    1.创建文件并且写入 2.多行读取文件的方式 readlines() 3.一次读取全部内容 4.文件的删除 5.shutil 模块实现文件的复制 6.文件的重命名 7.获取文件的后缀名 8.pytho ...

  5. Unicode Table

    Unicode Table http://www.tamasoft.co.jp/en/general-info/unicode.html   00 01 02 03 04 05 06 07 08 09 ...

  6. java strtus2 拦截器(Interceptors)

    在strtus2 中有一个比较重要的东西就是拦截器(Interceptors) 拦截器可以做到在已有的业务中插入一块共通的,比如在一个业务中,直接插入一串登录功能,就不用去每个页面一个个去显示是否登录 ...

  7. sql server自定义函数

    CREATE function [dbo].[f_testFunc]( ) ,) ) ) as begin ); ); ); ); SELECT @str_id = a.id,@str_code = ...

  8. 示例 - 如何在ASP.NET中应用Spider Studio生成的DLL?

    >> 接前文 "示例 - 如何在Console应用程序中应用SpiderStudio生成的DLL?", 将其运用到ASP.NET中: 1. 创建WebApplicati ...

  9. OAuth2.0 介绍

    一.基本协议流程: (1) Client请求RO(Resource Owner)的授权:请求中一般包含:要访问的资源路径,操作类型,Client的身份等信息.(2) RO批准授权:并将“授权证据”发送 ...

  10. 多媒体开发之rtsp---rtsp client 端的实现

    http://blog.csdn.net/xyz_lmn/article/details/6055179 java实现 http://www.cnblogs.com/wohexiaocai/p/454 ...