English 中文(简体)
当我使用TCP时 NODELAY and when TCP_CORK?
原标题:When should I use TCP_NODELAY and when TCP_CORK?

我的理解是,这两种方法都是可分辨的奈格尔算法。

我何时应该使用这些工具?

最佳回答

首先,他们不是两人都可以离开。 Nagle 算法。

Nagle 算法是减少更多的小型网络包裹。 算法是:如果数据少于限额(通常为MSS),则要等到收到以前寄出的包装单时,以及平均时间从用户那里积累数据。 然后发送所积累的数据。

if [ data > MSS ]
    send(data)
else
    wait until ACK for previously sent data and accumulate data in send buffer (data)
    And after receiving the ACK send(data)

这将有助于申请电话。 然而,在等待捷克克朗时,在发送数据时可能会增加相对性。 此外,如果接收人执行延迟的科索沃警察部队政策,就会造成暂时的僵局。 在这种情况下,拆解Nagles算法是一种更好的选择。

因此,TCP_NODELAY被用于拆解Nagle的算法。

TCP_CORK aggressively accumulates data. If TCP_CORK is enabled in a socket, it will not send data until the buffer fills to a fixed limit. Similar to Nagle s algorithm, it also accumulates data from user but until the buffer fills to a fixed limit not until receiving ACK. This will be useful while sending multiple blocks of data. But you have to be more careful while using TCP_CORK.

在2.6方言之前,这两种选择都是相互排斥的。 但是,在后来的摇篮中,两者可以共同存在。 在这种情况下,将给予TCP_CORK更多的优惠。

参看:

问题回答

<><>>t>TCP_NODELAY

利用Nagles算法改进TCP/IP网络,减少包装件数,直到收到以前发送的数据以发送累积包装单为止。

/From the tcp(7) Manual:

http://www.un.org/Depts/DGACM/index_french.htm

如果确定,不发放部分框架。 所有被问及的部分框架均在选择再次获得许可时发出。 这对于在打电话<><><>><>>>>上填写的头盔或用于优化投稿很有用。 如目前实施,在产出按<编码>计算时,有200-millisecond limit。 TCP_CORK。 如果达到这一上限,则自动传送数据。 这一选择可与<代码>合并。 TCP_NODELAY only since CESCR 2.5.71. 这种选择不应用于拟可携带的法典。

它与任何选择一样具有选择性:

  1. Do not use it
  2. Wait until performance becomes a problem, then having determined that socket latency is definitely the cause of it, and testing proves that this will definitely fix it, AND this is the easiest way of fixing it, do it.

基本目标是避免在使用单一框架时,用发送文件及其朋友发出若干框架。

例如,在网络服务器上,你寄送了头盔,然后是档案内容,头盔将装在册,然后由车库直接发送。 TCP_CORK允许你在单一框架内,甚至在TCP_NODELAY上,拥有头盔和档案的开始,否则就会立即寄出第一个空白。





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签