1

What disadvantages (or advantages) are there to setting different values for a send and receive buffer on opposite sides of a connection? It seems to make the most sense (and the norm) to keep these values the same. But if one side (say the sender side) has the resources to double their buffer size, what implications could this have?

I guess a related question is, what disadvantages are there to setting a larger-than-required buffer size? From what I've read, it sounds like you could potentially overflow the receive buffer if your send buffer is larger. Additionally, it seems like there may not be a need to increase buffer sizes as long as your applications are keeping up with the load and can handle max-size messages. It doesn't necessarily mean you could handle more data throughput because you are still limited by the opposite endpoint. Is this correct?

The specific kernel settings in question are as follows:

net.core.wmem_max
net.core.rmem_max
mdnghtblue
  • 1,117
  • 8
  • 27

2 Answers2

2

a large buffer size can have a negative effect on performance in some cases. If the TCP/IP buffers are too large and applications are not processing data fast enough, paging can increase. The goal is to specify a value large enough to avoid flow control, but not so large that the buffer accumulates more data than the system can process

Lakshmi Swetha G
  • 2,691
  • 1
  • 9
  • 13
0
  • A TCP send buffer size smaller than the receiver's receive buffer size will prevent you from using the maximum available bandwidth
  • a UDP send buffer larger than the receiver's receive buffer size will prevent you from finding out at source about datagrams that are too large.

Neither of these problems is major, unless you're transmitting large amounts of data in the TCP case. In the UDP case you shouldn't attempt to send datagrams larger than 534 (or 576 or whatever that magic number is) anyway.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • Thanks. Are there any issues with setting buffer sizes to the max size allowed on the system, even if the system can comfortably handle loads with 1/4 of that buffer size? Will that have adverse effects? – mdnghtblue Sep 24 '15 at 22:16