- 浏览: 2682858 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
80后的童年2:
深入浅出MongoDB应用实战开发网盘地址:https://p ...
MongoDB入门教程 -
shliujing:
楼主在不是精通java和php的前提下,请不要妄下结论。
PHP、CakePHP哪凉快哪呆着去 -
安静听歌:
希望可以一给一点点注释
MySQL存储过程之代码块、条件控制、迭代 -
qq287767957:
PHP是全宇宙最强的语言!
PHP、CakePHP哪凉快哪呆着去 -
rryymmoK:
深入浅出MongoDB应用实战开发百度网盘下载:链接:http ...
MongoDB入门教程
Persistent Connections
advantages:
- By opening and closing fewer TCP connections, CPU time is saved
in routers and hosts (clients, servers, proxies, gateways,
tunnels, or caches), and memory used for TCP protocol control
blocks can be saved in hosts.
- HTTP requests and responses can be pipelined on a connection.
Pipelining allows a client to make multiple requests without
waiting for each response, allowing a single TCP connection to
be used much more efficiently, with much lower elapsed time.
- Network congestion is reduced by reducing the number of packets
caused by TCP opens, and by allowing TCP sufficient time to
determine the congestion state of the network.
- Latency on subsequent requests is reduced since there is no time
spent in TCP's connection opening handshake.
- HTTP can evolve more gracefully, since errors can be reported
without the penalty of closing the TCP connection. Clients using
future versions of HTTP might optimistically try a new feature,
but if communicating with an older server, retry with old
semantics after an error is reported.
主流浏览器都支持persistent connection
像Firefox里就可以设置network.http.max-persistent-connections-per-server参数,默认为6
network.http.keep-alive.timeout参数默认为300ms
An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to maintain a persistent connection unless a Connection header including the connection-token "close" was sent in the request
If the server chooses to close the connection immediately after sending the response, it SHOULD send a Connection header including the connection-token close
An HTTP/1.1 client MAY expect a connection to remain open, but would decide to keep it open based on whether the response from a server contains a Connection header with the connection-token close
In case the client does not want to maintain a connection for more than that request, it SHOULD send a Connection header including the connection-token close
A client that supports persistent connections MAY "pipeline" its requests (i.e., send multiple requests without waiting for each response)
A server MUST send its responses to those requests in the same order that the requests were received
It is especially important that proxies correctly implement the properties of the Connection header field
The proxy server MUST signal persistent connections separately with its clients and the origin servers (or other proxy servers) that it connects to
Each persistent connection applies to only one transport link
Message Transmission Requirements
HTTP/1.1 servers SHOULD maintain persistent connections and use TCP's flow control mechanisms to resolve temporary overloads, rather than terminating connections with the expectation that clients will retry
An HTTP/1.1 (or later) client sending a message-body SHOULD monitor the network connection for an error status while it is transmitting the request
If the client sees an error status, it SHOULD immediately cease transmitting the body
The purpose of the 100 (Continue) status is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body
If an HTTP/1.1 client sends a request which includes a request body, but which does not include an Expect request-header field with the "100-continue" expectation, and if the client is not directly connected to an HTTP/1.1 origin server, and if the client sees the connection close before receiving any status from the server, the client SHOULD retry the request
If the client does retry this request, it MAY use the "binary exponential backoff" algorithm to be assured of obtaining a reliable response
advantages:
- By opening and closing fewer TCP connections, CPU time is saved
in routers and hosts (clients, servers, proxies, gateways,
tunnels, or caches), and memory used for TCP protocol control
blocks can be saved in hosts.
- HTTP requests and responses can be pipelined on a connection.
Pipelining allows a client to make multiple requests without
waiting for each response, allowing a single TCP connection to
be used much more efficiently, with much lower elapsed time.
- Network congestion is reduced by reducing the number of packets
caused by TCP opens, and by allowing TCP sufficient time to
determine the congestion state of the network.
- Latency on subsequent requests is reduced since there is no time
spent in TCP's connection opening handshake.
- HTTP can evolve more gracefully, since errors can be reported
without the penalty of closing the TCP connection. Clients using
future versions of HTTP might optimistically try a new feature,
but if communicating with an older server, retry with old
semantics after an error is reported.
主流浏览器都支持persistent connection
像Firefox里就可以设置network.http.max-persistent-connections-per-server参数,默认为6
network.http.keep-alive.timeout参数默认为300ms
An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to maintain a persistent connection unless a Connection header including the connection-token "close" was sent in the request
If the server chooses to close the connection immediately after sending the response, it SHOULD send a Connection header including the connection-token close
An HTTP/1.1 client MAY expect a connection to remain open, but would decide to keep it open based on whether the response from a server contains a Connection header with the connection-token close
In case the client does not want to maintain a connection for more than that request, it SHOULD send a Connection header including the connection-token close
A client that supports persistent connections MAY "pipeline" its requests (i.e., send multiple requests without waiting for each response)
A server MUST send its responses to those requests in the same order that the requests were received
It is especially important that proxies correctly implement the properties of the Connection header field
The proxy server MUST signal persistent connections separately with its clients and the origin servers (or other proxy servers) that it connects to
Each persistent connection applies to only one transport link
Message Transmission Requirements
HTTP/1.1 servers SHOULD maintain persistent connections and use TCP's flow control mechanisms to resolve temporary overloads, rather than terminating connections with the expectation that clients will retry
An HTTP/1.1 (or later) client sending a message-body SHOULD monitor the network connection for an error status while it is transmitting the request
If the client sees an error status, it SHOULD immediately cease transmitting the body
The purpose of the 100 (Continue) status is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body
If an HTTP/1.1 client sends a request which includes a request body, but which does not include an Expect request-header field with the "100-continue" expectation, and if the client is not directly connected to an HTTP/1.1 origin server, and if the client sees the connection close before receiving any status from the server, the client SHOULD retry the request
If the client does retry this request, it MAY use the "binary exponential backoff" algorithm to be assured of obtaining a reliable response
发表评论
-
leveldb资料整理
2011-12-28 19:50 10845leveldb介绍 http://code.google.co ... -
HTTP Basic/Digest Authentication、OAuth
2009-01-09 14:01 9614HTTP Authentication au ... -
HTTP1.1 Notes 8, Header Field Definitions
2008-12-31 13:13 4451http://www.w3.org/Protocols/rfc ... -
HTTP1.1 Notes 7, Status Code Definitions
2008-12-30 15:01 3303Informational 1xx This class of ... -
HTTP1.1 Notes 6, Method Definitions
2008-12-30 12:30 2505Safe and Idempotent Methods In ... -
HTTP1.1 Notes 4, Request & Response & Entity
2008-12-26 13:25 4196Request Request = ... -
HTTP1.1 Notes 3, HTTP Message
2008-12-26 10:57 4216Message Types HTTP-mess ... -
HTTP1.1 Notes 2, Protocol Parameters
2008-12-24 13:12 2715HTTP Version HTTP-Versio ... -
HTTP1.1 Notes 1, Terminology & ABNF
2008-12-23 17:03 2838http://www.w3.org/Protocols/rfc ... -
以后都用MindManager做年度总结和年度计划
2008-12-19 19:54 60212008总结如下: 2009计划如下: 希望自己能够戒骄 ... -
Skip List 跳表
2008-12-19 15:54 5557跳表是个概率性的的数据结构,由William Pugh在199 ... -
数据仓库toolkit笔记1,Dimensional Modeling Primer
2008-12-15 18:49 2429数据仓库管理员的主要职责: 1,通过业务领域、工作职责和计算机 ... -
CLRS笔记15,动态规划
2008-12-10 18:14 1888动态规划算法的实质是分治思想和解决冗余,因此,动态规划是一种将 ... -
Web搜索引擎原理和技术
2008-12-08 12:06 4860主要的三个功能模块: ... -
CLRS笔记12,二叉查找树/红黑树
2008-12-04 17:32 2828二叉查找树 二叉查找树是一颗二叉树,并且每个节点x的左子树中所 ... -
CLRS笔记11,Hash Table
2008-12-03 15:02 2019Hash Table是实现动态集合在O(1)时间内的INSER ... -
CLRS笔记10、基本数据结构
2008-11-28 14:28 1910数学中的集合是不变的 ... -
CLRS笔记8,线性时间排序(counting、radix、bucket sort)
2008-11-27 11:13 3497线性时间排序即时间复杂度为Θ(n)的排序,主要有计数排序、基数 ... -
How to be Computer Game Developer?
2008-07-21 13:35 1269http://www.beyondrails.com/blog ... -
游戏引擎剖析
2008-07-21 11:59 2405转载一篇《游戏引擎剖析》系列,了解游戏引擎开发相关的知识。 ...
相关推荐
1.1支持长连接(Persistent connections) 1.1支持分块编码(chunked-encoding) 1.1支持缓存 1.1支持压缩和解压缩
Lotus Connections是一款企业社交软件,集成后,用户可以在Notes中直接访问企业内部的社交网络资源。 #### 二、Lotus Domino 8.5服务器的新特性 ##### 2.1 Domino Attachment and Object Service (DAOS) DAOS是一...
1.1 A Regression Example 4 1.2 Hypothesis Testing 8 1.3 Notes 11 2 Frequentist Inference 12 2.1 Frequentism in Practice 14 2.2 Frequentist Optimality 18 2.3 Notes and Details 20 3 Bayesian Inference ...
PEP 314: Metadata for Python Software Packages v1.1 PEP 328: Absolute and Relative Imports PEP 338: Executing Modules as Scripts PEP 341: Unified try/except/finally PEP 342: New Generator Features...
Notes Regarding Cascading Operations 11. Zend_Debug 11.1. 输出变量的值 (Dumping Variables) 12. Zend_Exception 12.1. 使用“异常” 13. Zend_Feed 13.1. 介绍 13.2. 导入Feeds 13.2.1. 定制 feeds ...
Release Notes 完整版下载:http://www.oracle.com/technology/global/cn/software/products/sql/index.html 1. Known Issues 1.1 General - Print prints only one page that is a truncation of the current ...
Introducing CGI and mod_perl Section 1.1. A Brief History of CGI Section 1.2. The Apache 1.3 Server Model Section 1.3. The Development of mod_perl 1.0 Section 1.4. Apache 1.3 ...
1.1 Book Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.2 Wireless Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.3 Book Outline . . . . . . . ....
RowSet 1.1: The introduction of the RowSetFactory interface and the RowSetProvider class, which enable you to create all types of row sets supported by your JDBC driver; see Using the RowSetFactory ...
Preface, Notes, Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
1.1 Use the Latest OS Release .............................................................................................................. 13 1.2 Apply Latest OS Patches ...............................