(1) sendfile 参数使用于开启文件的高效传输模式,该参数实际上是激活了 sendfile() 功能,sendfile() 是作使用于两个文件形容符之间的数据拷贝函数,这个拷贝操作是在内核之中的,被称为 "零拷贝" ,sendfile() 比 read 和 write 函数要高效得多,由于 read 和 write 函数要把数据拷贝到应使用层再进行操作
(2) tcp_nopush 参数使用于激活 Linux 上的 TCP_CORK socket 选项,此选项仅仅当开启 sendfile 时才生效,tcp_nopush 参数可以允许把 http response header 和文件的开始部分放在一个文件里发布,以减少网络报文段的数量
cat /usr/local/nginx/conf/nginx.conf
......
http {
include mime.types;
server_names_hash_bucket_size 512;
default_type application/octet-stream;
sendfile on; # 开启文件的高效传输模式
tcp_nopush on; # 激活 TCP_CORK socket 选择
tcp_nodelay on; #数据在传输的过程中不进缓存
keepalive_timeout 65;
server_tokens off;
include vhosts/*.conf;
}
¥515.00
XGPU3年充值卡Xbox Game Pass Ultimate 三年win10 pc主机终极会员非14天EA Play xgp兑换码pgp激活码礼品卡
¥510.00
自动秒发 XBOX美区礼品卡微软XBOX礼品卡美国 XBOX Live美金充值点卡 1/5/10/15/100美元兑换码代充激活码USD
¥23.50
XGPU14天充值卡Xbox Game Pass Ultimate 终极会员win10 pc主机EA Play金会员 xgp兑换码激活码礼品卡
¥27.50
Steam 大富翁10 激活码CDKey 大富翁10 RichMan 10 大富翁十休闲联机 PC中文国区全球正版激活码 大富翁游戏
¥9.90
win10/PC MagicPods 魔豆 兑换码 下载码 激活码 Windows10 MagicPods AirPods耳机工具程序 Win11微软商店
¥325.00
XGPU2年充值卡Xbox Game Pass Ultimate二年win10 pc主机终极会员EA Play金会员非14天xgp兑换码激活码礼品卡