AD

size_t备忘

rmem_default
contains the default setting in bytes of the socket receive
buffer.

rmem_max
contains the maximum socket receive buffer size in bytes
which a user may set by using the SO_RCVBUF socket option.

However, you can tune these values. Guess that's why you may find the
rmem_max is smaller than that in rmem_default, i.e. before you tune the
values.

Tune values

Set the max OS send buffer size (wmem) and receive buffer size (rmem) to 12
MB for queues on all protocols. In other words set the amount of memory
that is allocated for each TCP socket when it is opened or created while
transferring files:

WARNING! The default value of rmem_max and wmem_max is about 128 KB in most Linux distributions, which may be enough for a low-latency general purpose
network environment or for apps such as DNS / Web server. However, if the
latency is large, the default size might be too small. Please note that the
following settings going to increase memory usage on your server.

# echo 'net.core.wmem_max=12582912' >> /etc/sysctl.conf
# echo 'net.core.rmem_max=12582912' >> /etc/sysctl.conf

There are plenty of man pages on the Internet, which you can easily find
the references.

Hope it help.

Regards,

Sofia
1) On success, these calls return the number of characters sent. The size
of ssize_t itself is not the same thing as the number of characters sent.

2) SO_RCVBUF
Sets or gets the maximum socket receive buffer in bytes. The kernel
doubles this value (to allow space for bookkeeping overhead) when it
is set using setsockopt(2), and this doubled value is returned by
getsockopt(2). The default value is set by the

/proc/sys/net/core/rmem_default file, and the maximum allowed value
is set by the /proc/sys/net/core/rmem_max file. The minimum (doubled)
value for this option is 256.

3) If the message is too long to pass atomically through the underlying
protocol, the error EMSGSIZE is returned, and the message is not
transmitted.

Hope this help.

Regards,

Sofia

评论

此博客中的热门博文

简单粗暴导出小米便签

我——终于一个人了

Ubiquiti_Networks_UniFi_Cloud_Key_authed_rce