-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
The SO_SNDBUF/SO_RCVBUF should not be set , the kernel will control it smartly, and have better performance than fixed value in most case.
the specified buffer can not greater than net.core.wmem_max/net.core.rmem_max, but kernal automantic control can increase to a larger value.
This problem decrease throughput especially in below case:
- this latency between broker and producer(or consumer) is large, especially for consumer
- the message body size is big
We implements a ping command using rocketmq remoting.
The new version we remove the below code in NettyRemotingClient/NettyRemotingServer
.option(ChannelOption.SO_SNDBUF, nettyClientConfig.getClientSocketSndBufSize())
.option(ChannelOption.SO_RCVBUF, nettyClientConfig.getClientSocketRcvBufSize())
The old version is 4.9.2, the test result is:
The tps of new version is upper to 20x faster than old version.
The kernel config is
net.core.wmem_max = 212992
net.core.rmem_max = 212992
net.ipv4.tcp_rmem = 4096 87380 6291456
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.wmem_default = 212992
net.core.rmem_default = 212992
in one broker (M/S sync master async flush), one producer send test.
- 250 byte body: 0.93x old version (the new version is slower slightly)
- 4000 byte body: 3.85x of old version
- 16000 byte body: 6.07x of old version
- 100000 byte body: 7.93x of old version
The old version is 4.9.3-SNAPSHOT in this test. In this test the network latency from producer to broker is 1.61ms.