|
- cat /proc/sys/net/core/wmem_max
复制代码
sysctl -a | egrep "rmem|wmem|tcp_mem|adv_win|moderate"
几个发送buffer相关的内核参数
$sudo sysctl -a | egrep "rmem|wmem|tcp_mem|adv_win|moderate"
net.core.rmem_default = 212992
net.core.rmem_max = 212992
net.core.wmem_default = 212992 //core是给所有的协议使用的,
net.core.wmem_max = 212992
net.ipv4.tcp_adv_win_scale = 1 //
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_rmem = 4096 87380 6291456 //最小值 默认值 最大值】
net.ipv4.tcp_wmem = 4096 16384 4194304 //tcp这种就自己的专用选项就不用 core 里面的值了
net.ipv4.udp_rmem_min = 4096
net.ipv4.udp_wmem_min = 4096
vm.lowmem_reserve_ratio = 256 256 32
net.ipv4.tcp_mem = 88560 118080 177120
vm.lowmem_reserve_ratio = 256 256 32
net.ipv4.tcp_wmem 默认就是16K,而且内核是能够动态调整的,只不过我们代码中这块的参数是很多年前从Cobra中继承过来的,初始指定了sendbuffer的大小。代码中设置了这个参数后就关闭了内核的动态调整功能,这就是为什么http或者scp都很快,因为他们的send buffer是动态调整的。
rmem_max:一个Socket的读缓冲区可由程序设置的最大值,单位字节;
wmem_max:一个Socket的写缓冲区可由程序设置的最大值,单位字节;
rmem_default:一个Socket的被创建出来时,默认的读缓冲区大小,单位字节;
wmem_default:一个Socket的被创建出来时,默认的写缓冲区大小,单位字节;
在请求往缓冲区写数据的时候 出现 代码为 11 的 错误 Resource temporarily unavailable
是什么原因?
而且查看了缓冲区的大小设置 感觉还远没有写满啊?
|
|