HTTP Server Control

HTTP Read / Write buffer : This can controlled via following configuration parameters in your configuration files.


Parameter NameDescriptionDefault Value
netty.tcp.server.backlogThe maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter. If a connection indication arrives when the queue is full, the connection is refused.8192
netty.tcp.server.tcpNoDelay

The value of this socket option is a Boolean that represents whether the option is enabled or disabled.

true
netty.tcp.server.sendBufferSize

Set a hint the size of the underlying buffers for outgoing network I/O.

1048576
netty.tcp.server.receiveBufferSize.maxMaximum number of bytes to receive over a TCP connection1048576
netty.tcp.server.receiveBufferSize.minMinimum number of bytes to receive over a TCP connection64
netty.tcp.server.receiveTotalSize.maxTotal size in bytes to receive over a TCP connection1048576
netty.tcp.server.receiveBufferSize.defDefault size in bytes to receive over a TCP connection65536
netty.tcp.server.writeBufferLowWaterMark

Sets the low water mark of the write buffer. Once the number of bytes queued in the write buffer exceeded the high water mark and then dropped down below this value, Channel.isWritable() will return true again.

32768
netty.tcp.server.writeBufferHighWaterMarkSets the high water mark of the write buffer. If the number of bytes queued in the write buffer exceeds this value, Channel.isWritable()  will start to return false.131072


 

Example: Here is the configuration setting to receive large data value over HTTP (2MB)

Sample Write Buffer Setting
<netty.tcp.server.receiveTotalSize.max>3048576</netty.tcp.server.receiveTotalSize.max>
<netty.tcp.server.receiveBufferSize.max>2048576</netty.tcp.server.receiveBufferSize.max>
<netty.tcp.server.receiveBufferSize.min>64</netty.tcp.server.receiveBufferSize.min>
<netty.tcp.server.receiveBufferSize.def>65536</netty.tcp.server.receiveBufferSize.def>
<netty.tcp.server.writeBufferLowWaterMark>32768</netty.tcp.server.writeBufferLowWaterMark>
<netty.tcp.server.writeBufferHighWaterMark>3048576</netty.tcp.server.writeBufferHighWaterMark>>


Warning

  • The default parameter values above are determined by large developer’s community to provide reasonable balance between performance and memory consumption in most if not all real life situations.
  • Changing them may *significantly degrade* overall engine performance and must be considered only for rapid prototyping, testing or as a very last resort when absolutely no other option is available.
  • The necessity of increasing maximum buffer sizes beyond default limits usually indicates major application design problems.
  • You are strongly encouraged to [re]design your application/API properly instead of “quick-n-dirty” fix of increasing buffer size.