Beware. Each time you call
*setsockopt(SO_SNDBUF)*
even with a high value, you are likely _decreasing_ your max send buffer!
The default max for linux tcp autotune is 4MiB.
By calling setsockopt() you are _disabling_ autotune!
The default net.core.wmem_max is just 208KiB.
Conversation
You can save a lot of memory without actually losing throughput by setting net.ipv4.tcp_notsent_lowat to a value like 128k to cap how much buffer space it allocates beyond the scaled window size. As long as your applications can fill the buffer quickly, you won't lose throughput.


