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 ...
随机推荐
- Vmware linux 无法上网
流程如下: 1)点击 VM->Settings Hardware选项卡下面 2)点击Network Adapter 设置如下图所示,首先我们在虚拟机中将网络配置设置成NAT, 3.进入Windo ...
- element UI 的学习一,路由跳转
1.项目开始: # 安装vue $ cnpm install vue@2.1.6 # 全局安装 vue-cli $ cnpm install --global vue-cli ...
- VisualStudio“在查找预编译头使用时跳过"解决方案
解决方案1:确保所有的cpp文件都包含了stdafx.h,且确保stdafx.h是第一个#include指令(经尝试,可行) 解决方案2:去掉预编译头 项目->属性->配置属性->c ...
- android bitmap compress
android的照相功能随着手机硬件的发展,变得越来越强大,能够找出很高分辨率的图片. 有些场景中,需要照相并且上传到服务,但是由于图片的大小太大,那么就上传就会很慢(在有些网络情况下),而且很耗流量 ...
- linux如何查看CPU,内存,机器型号,网卡信息
查看CPU信息(型号)# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 8 Intel(R) Xeon(R) CPU ...
- Unix系统编程()brk,sbrk
在堆上分配内存 进程可以通过增加堆的大小来分配内存,所谓堆是一段长度可变的连续虚拟内存,始于进程的未初始化数据段末尾,随着内存的分配和释放而增减.通常将堆的当前内存边界称为"program ...
- 一个性能较好的JVM参数配置(转)
一个性能较好的web服务器jvm参数配置: -server//服务器模式-Xmx2g //JVM最大允许分配的堆内存,按需分配-Xms2g //JVM初始分配的堆内存,一般和Xmx配置成一样以避免每次 ...
- koa介绍
https://github.com/koajs/koa https://github.com/demopark/koa-docs-Zh-CN ctx.response.type = 'json'; ...
- shell向python传参数
想要在shell中调用python脚本时实现: python pyServer.py argu1 argu2 argu3 利用 sys.argv 即可读取到 相应参数: # coding=utf-8 ...
- java基础知识总结8(数据库篇1)
一. Oracle的安装(windowXP.win7.Linux)和卸载 1.1 Oracle的安装 1.1.1 在WindowsXP.Win7下安装 第一:解压win32_11gR2_databas ...