Commit 644c7659 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

kerndat: tcp_max_rshare -- Shrink default size

In commit 664659a0 we defined max possible
values for TCP queues but on low memory
machines (or on machinese whith custom limits
set via sysctl) this trick doesn't work well
all the time. We have to fetch the allowed values
from /proc/sys/net/ipv4/tcp_[wmem|rmem] which
might be simply missing on the environment
we run.

So lets stick with really small values here
got from kernel source code so instead of failing
we would be able to restore in a bit "slower"
than usual.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 64cf10f8
......@@ -21,7 +21,23 @@
#include "lsm.h"
struct kerndat_s kdat = {
.tcp_max_rshare = 3U << 20,
/*
* TCP send receive buffers are calculated
* dynamically by the kernel taking into account
* the size of memory present on the machine.
*
* On machines with huge amount of memory it grants
* up to 4M for sendding buffer and 6M for receiving.
* But in turn for low mem machines these limits
* are quite small down to 16K for sending and
* 87380 for receiving.
*
* We will find out precise limits in tcp_read_sysctl_limits
* but by default lets stick for small data to not fail
* on restore: better to slowdown restore procedure than
* failing completely.
*/
.tcp_max_rshare = 87380,
};
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment