0

If I change settings like this for example:

# sysctl -w net.core.rmem_default=500000
# sysctl -w net.ipv4.tcp_rmem='4000 90000 10000000' 
  1. Is it safe to do this in a heavy duty live production machine (CentOS 7)? Are there any known risks?
  2. Does this change apply to previously established sockets that are currently streaming data on the system?
  3. If not, does this change require the process or the shell to be restarted to take effect?

2 Answers2

1
  1. It's completely safe.

  2. Not, new values of these sysctl variables affect only the new sockets.

  3. After restart, process will recreate socket with new default values. But process can set the buffer size itself with SO_RCVBUF socket option.

Anton Danilov
  • 5,082
  • 2
  • 13
  • 23
0

Per redhat documentation rmem_default should be no greater than rmem_max.

rmem_default: is the default OS receive buffer size for all types of connections. So don't give too big values till it's absolutely required *defaults works most of the time).

tcp_rmem : The first value tells the kernel the minimum receive buffer for each TCP connection, and this buffer is always allocated to a TCP socket, even under high pressure on the system. ... The second value specified tells the kernel the default receive buffer allocated for each TCP socket. This value overrides the /proc/sys/net/core/rmem_default value used by other protocols. ... The third and last value specified in this variable specifies the maximum receive buffer that can be allocated for a TCP socket.

you can reload you setting through sysctl --system

asktyagi
  • 2,860
  • 2
  • 8
  • 25