nginx学习随笔--tcp-nopush

来源:互联网 发布:查看8080端口被占用 编辑:程序博客网 时间:2024/06/06 02:16

nginx学习随笔–tcp-nopush

英文原文:

Syntax: tcp_nopush on | off;Default:    tcp_nopush off;Context:    http, server, location

Enables or disables the use of the TCP_NOPUSH socket option on FreeBSD or the TCP_CORK socket option on Linux. The options are enabled only when sendfile is used. Enabling the option allows

  • sending the response header and the beginning of a file in one
    packet, on Linux and FreeBSD 4.*;
  • sending a file in full packets.

中文翻译:
允许或禁止在FreeBSD平台上的TCP_NOPUSH套接字选项或者linux平台上的TCP_CORK套接字选项。这些选项只有在使用sendfile启用的情况下才能被允许。被允许后可以:
在一个数据包里发送请求头和文件的开始部分;
在一个完整的数据包里发送文件。

  • 在nginx中,tcp_nopush配置与tcp_nodelay“互斥”。它可以配置一次发送数据包的大小。也就是说,数据包累积到一定大小后就发送。

  • 在nginx中tcp_nopush必须和sendfile配合使用。

原创粉丝点击