w非全尺寸分组的发送条件

HTTP The Definitive Guide

TCP has a data stream interface that permits applications to stream data of any size to the TCP stack—
even a single byte at a time! But because each TCP segment carries at least 40 bytes of flags and
headers, network performance can be degraded severely if TCP sends large numbers of packets
containing small amounts of data.
[5]

[5]
Sending a storm of single-byte packets is called "sender silly window syndrome." This is inefficient, anti-
social, and can be disruptive to other Internet traffic.
Nagle's algorithm (named for its creator, John Nagle) attempts to bundle up a large amount of TCP
data before sending a packet, aiding network efficiency. The algorithm is described in RFC 896,
"Congestion Control in IP/TCP Internetworks."
Nagle's algorithm discourages the sending of segments that are not full-size (a maximum-size packet
is around 1,500 bytes on a LAN, or a few hundred bytes across the Internet). Nagle's algorithm lets
you send a non-full-size packet only if all other packets have been acknowledged. If other packets are
still in flight, the partial data is buffered. This buffered data is sent only when pending packets are
acknowledged or when the buffer has accumulated enough data to send a full packet.
[6]

[6]
Several variations of this algorithm exist, including timeouts and acknowledgment logic changes, but the
basic algorithm causes buffering of data smaller than a TCP segment.
Nagle's algorithm causes several HTTP performance problems. First, small HTTP messages may not
fill a packet, so they may be delayed waiting for additional data that will never arrive. Second, Nagle's
algorithm interacts poorly with disabled acknowledgments—Nagle's algorithm will hold up the
sending of data until an acknowledgment arrives, but the acknowledgment itself will be delayed 100-
200 milliseconds by the delayed acknowledgment algorithm.
[7]

[7]
These problems can become worse when using pipelined connections (described later in this chapter),
because clients may have several messages to send to the same server and do not want delays. HTTP applications often disable Nagle's algorithm to improve performance, by setting the
TCP_NODELAY parameter on their stacks. If you do this, you must ensure that you write large
chunks of data to TCP so you don't create a flurry of small packets.

Nagle's Algorithm and TCP_NODELAY的更多相关文章

  1. Nagle's algorithm

    w41字节的数据包只有1字节的可用信息.以减少数据包发送量来提高TCP/IP网络性能. https://en.wikipedia.org/wiki/Nagle's_algorithm https:// ...

  2. Nagle's algorithm 封包 网络游戏协议封包需注意点 封包挂

    w41字节的数据包只有1字节的可用信息.以减少数据包发送量来提高TCP/IP网络性能. https://en.wikipedia.org/wiki/Nagle's_algorithm https:// ...

  3. linux tcp Nagle算法,TCP_NODELAY和TCP_CORK 转载

    转载自: http://www.cnhalo.net/2016/08/13/linux-tcp-nagle-cork/ http://abcdxyzk.github.io/blog/2018/07/0 ...

  4. TCP Nagle算法&&延迟确认机制

    TCP Nagle算法&&延迟确认机制 收藏 秋风醉了 发表于 3年前 阅读 1367 收藏 0 点赞 0 评论 0 [腾讯云]买域名送云解析+SSL证书+建站!>>> ...

  5. 神秘的40毫秒延迟与 TCP_NODELAY

    写 HTTP Server,不可免俗地一定要用 ab 跑一下性能,结果一跑不打紧,出现了一个困扰了我好几天的问题:神秘的 40ms 延迟. Table of Contents 1 现象 2 背后的原因 ...

  6. TCP_NODELAY 和 TCP_NOPUSH的解释

    一.问题的来源 今天看到 huoding 大哥分享的 lamp 面试题,其中一点提到了: Nginx 有两个配置项: TCP_NODELAY 和 TCP_NOPUSH ,请说明它们的用途及注意事项. ...

  7. Nagle算法&&延时确认

    数据流分类 成块数据 交互数据   Rlogin需要远程系统(服务器)回显我们(客户)键入的字符 数据字节和数据字节的回显都需要对方确认 rlogin 每次只发送一个字节到服务器,而Telnet 可以 ...

  8. tcp 粘包 和 TCP_NODELAY 学习

    TCP通信粘包问题分析和解决  在socket网络程序中,TCP和UDP分别是面向连接和非面向连接的.因此TCP的socket编程,收发两端(客户端和服务器端)都要有成对的socket,因此,发送端为 ...

  9. 仔细看参数--NGINX之tcp_nodelay

    一.知识准备 ● 在nginx优化中有个经常需要设置的参数,tcp_nodelay ● 该参数最核心的功能,就是把小包组成成大包,提高带宽利用率也就是著名的nagle算法 ● tcp协议中,有一个现象 ...

随机推荐

  1. HttpURLConnection上传文件

    HttpURLConnection上传文件 import java.io.BufferedReader; import java.io.DataInputStream; import java.io. ...

  2. 在sql中根据成绩显示学生排名

    1.准备 create table newtable ( name ), yuwen ), shuxue ) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; , ); , ...

  3. Bootstrap学习笔记(3)--菜鸟网CDN

    Bootstrap CDN 推荐 本站实例采用的是自建的静态资源库上的Bootstrap资源. <!-- 新 Bootstrap 核心 CSS 文件 --> <link href=& ...

  4. [转]使用rosbridge协议实现安卓跟ros的解耦

    安卓与ROS通信的现状 因为ROS官方支持的语言绑定只有C++和Python,所以目前安卓想与ROS通信,必须借助半官方的rosjava包,而Rosjava太重了,因为它跟C++/Python一样,是 ...

  5. 用Zend OPCache提高PHP的性能

    Zend OPCache的前身是Zend Optimizer + (Zend O+),在PHP5.5的发行版本中自带了Zend O+,并重新命名为:Zend OPCache.但是默认是没有启用的,可以 ...

  6. QQ空间定时留言程序。

    已经可以自动登录了... 求指点..... 注意:启动时QQ号要填别人的.(留言程序只支持给别人留言) 源码路径:  https://github.com/gaoconggit/QQ-.git  

  7. jhipster(springboot+datatable+jpa)后台分页,总结

    最近用datatable做了一个后台分页,但是后台实体原本没写DTO.就碰到的问题做了一下总结 一.datatable使用get方式传数据到后台,这是正常的后台分页,不涉及过滤查询和前端传递的排序字段 ...

  8. Jhipster token签名异常——c.f.o.cac.security.jwt.TokenProvider : Invalid JWT signature.

    背景,jHipster自动生成的springBoot和angularJs前后台端分离的项目.java后台为了取到当前登录者的信息,所以后台开放了 MicroserviceSecurityConfigu ...

  9. windows CMD命令大全及详细解释和语法

    http://blog.csdn.net/god_7z1/article/details/51173067

  10. zookeeper配置详解

    原文地址: http://itindex.net/detail/40187-zookeeper-%E7%AE%A1%E7%90%86%E5%91%98-%E7%AE%A1%E7%90%86 参数名 说 ...