0

I am trying to increase the socket receive buffer size using setsockopt beyond the rmem_max. As per man page the maximum allowed value is set by the /proc/sys/net/core/rmem_max file.

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.

However setting the size beyond rmem_max did not fail and the getsockopt also returns the newvalue beyond the rmem_max. Does it mean the buffer is actually increased?

Karthick
  • 1,010
  • 1
  • 8
  • 24
  • What's the goal here? The only reason for having absurdly large buffers is if your program is really bad at servicing the socket. – tadman Nov 06 '20 at 09:04
  • @tadman Yes. Sometimes it is not able to handle the packets. – Karthick Nov 06 '20 at 09:10
  • How could you _test_ the buffer size? – Gábor Nov 06 '20 at 10:35
  • How do your `net.ipv4.tcp_rmem` settings look like (aka is this https://stackoverflow.com/questions/31546835/tcp-receiving-window-size-higher-than-net-core-rmem-max maybe relevant)? Also for overriding `rmem_max`, you'll need `SO_RCVBUFFORCE` and `CAP_NET_ADMIN`. – Nikolaos Chatzis Nov 06 '20 at 17:42

0 Answers0