TCP requires two packet transfers to set up the connection before it can send data
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的更多相关文章
- CC3200在AP模式的TCP sock作为客户端连接时返回SL_ECONNREFUSED(-111) Connection refused
1. CC3200处于AP模式(电脑无线连接CC3200的WIFI信号),开启一个TCP socket,这个socket作为TCP客户端去连接TCP服务器端 struct sockaddr_in ad ...
- jmeter压测tcp协议接口:java.net.SocketException: Software caused connection abort: socket write error
tcp接口,试压过程中,部分请求报如下错误: java.net.SocketException: Software caused connection abort: socket write erro ...
- Mini2440 DM9000 驱动分析(一)
Mini2440 DM9000 驱动分析(一) 硬件特性 Mini2440开发板上DM9000的电气连接和Mach-mini2440.c文件的关系: PW_RST 连接到复位按键,复位按键按下,低电平 ...
- Linux skbuff注释笔记
SKB结构定义 /usr/src/linux/include/linux/skbuff.h sk_buff_head: struct sk_buff_head { //SKB的头结点 /* The ...
- commit Commit changes to stable storage 对变化提交
Python36\site-packages\pymysql\connections.py # Python implementation of the MySQL client-server pro ...
- 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/ ...
- python之I/O多路复用
python IO多路复用 一.多路复用概念: 监听多个描述符(文件描述符(windows下暂不支持).网络描述符)的状态,如果描述符状态改变 则会被内核修改标志位,进而被进程获取进而进行 ...
- 推荐一个比FiddlerCore好用的HTTP(S)代理服务器
为什么不用FiddlerCore? 说到FiddlerCore大家可能会比较陌生,那么它哥Fiddler就比较熟悉了:抓包.模拟低带宽.修改请求我平时比较常用.Fiddler的本质就是一个HTTP代理 ...
- 最简单的基于librtmp的示例:发布(FLV通过RTMP发布)
===================================================== 最简单的基于libRTMP的示例系列文章列表: 最简单的基于librtmp的示例:接收(RT ...
随机推荐
- 【Java】验证码识别解决方案
对于类似以下简单的验证码的识别方案: 1. 2 3 4. 1.建库:切割验证码为单个字符,人工标记,比如:A. 2.识别:给一个验证码:切割为单个字符,在库中查询识别. /*** * author:c ...
- TIM—高级定时器
本章参考资料:< STM32F4xx 参考手册>.< STM32F4xx 规格书>.库帮助文档< stm32f4xx_dsp_stdperiph_lib_um.chm&g ...
- ParagraphFormat 对象【精品】
ParagraphFormat 对象 贡献者:motolola 日期:2009-05-27 阅读:5261 回复: 相关标签:wps > API > paragraphfo ...
- Windows Phone 修改系统定义的资源颜色
[问题的背景] 相信有些经验的WP研发同学都会遇到下面的问题: 系统控件以及WPToolkit中大量使用了PhoneAccentBrush这个画刷(这个画刷定义的是系统的强调色,即用户选择的主题颜色) ...
- 广义线性模型 - Andrew Ng机器学习公开课笔记1.6
在分类问题中我们如果: 他们都是广义线性模型中的一个样例,在理解广义线性模型之前须要先理解指数分布族. 指数分布族(The Exponential Family) 假设一个分布能够用例如以下公式表达, ...
- Redis简单介绍
redis简单介绍 Redis VS key-value缓存产品 Redis支持数据的持久化,能够将内存中的数据保持在磁盘中,重新启动的时候能够再次载入进行使用. Redis不只支持简单的key-va ...
- java 基础数据结构
数据结构, 需要考虑两个方面: 1. 每个元素具体的存储方法 (java中是一个对象) 2. 元素之间的关系如何实现存储 (java中也是一个对象) 另外在java中, 已经可以把跟数据结构有关的一些 ...
- 打开palette控制面板
(2)
- python中的字典 和 集合
python中字典是一种key-value的数据类型 字典的特性: 1.无序的 2.key必须的唯一的,so,字典天生去重 语法: 增加 修改 删除 查找 多级字典嵌套及操作 字典的其他用法 #set ...
- JavaBeans wiki 摘译
20161013最新提示:既然来到这了,为什么不看看 JavaBeans 官方文档学习 ? 鉴于Spring的beans包遵守JavaBean specs,有必要认真研究下JavaBean specs ...