Skip to content

Commit 80decfa

Browse files
authored
Change tcp_nodelay config to be true (#4986)
* Change tcp_nodelay config * Update changelog.md * Update CHANGELOG.md for version
1 parent b56fa46 commit 80decfa

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ librdkafka v2.9.0 is a feature release:
3737
becomes reachable again (#4970).
3838
* Remove a one second wait after a partition fetch is restarted following a
3939
leader change and offset validation (#4970).
40+
* Fix the Nagle algorithm (TCP_NODELAY) on broker sockets to not be enabled
41+
by default (#4986).
4042

4143

4244
## Fixes
@@ -99,6 +101,12 @@ librdkafka v2.9.0 is a feature release:
99101
the broker the request is enqueued on is up again.
100102
Solved by not retrying these kinds of metadata requests.
101103
Happens since 1.x (#4970).
104+
* The Nagle algorithm (TCP_NODELAY) is now disabled by default. It caused a
105+
large increase in latency for some use cases, for example, when using an
106+
SSL connection.
107+
For efficient batching, the application should use `linger.ms`,
108+
`batch.size` etc.
109+
Happens since: 0.x (#4986).
102110

103111
### Consumer fixes
104112

Diff for: CONFIGURATION.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ socket.blocking.max.ms | * | 1 .. 60000 | 1000
2626
socket.send.buffer.bytes | * | 0 .. 100000000 | 0 | low | Broker socket send buffer size. System default is used if 0. <br>*Type: integer*
2727
socket.receive.buffer.bytes | * | 0 .. 100000000 | 0 | low | Broker socket receive buffer size. System default is used if 0. <br>*Type: integer*
2828
socket.keepalive.enable | * | true, false | false | low | Enable TCP keep-alives (SO_KEEPALIVE) on broker sockets <br>*Type: boolean*
29-
socket.nagle.disable | * | true, false | false | low | Disable the Nagle algorithm (TCP_NODELAY) on broker sockets. <br>*Type: boolean*
29+
socket.nagle.disable | * | true, false | true | low | Disable the Nagle algorithm (TCP_NODELAY) on broker sockets. <br>*Type: boolean*
3030
socket.max.fails | * | 0 .. 1000000 | 1 | low | Disconnect from broker when this number of send failures (e.g., timed out requests) is reached. Disable with 0. WARNING: It is highly recommended to leave this setting at its default value of 1 to avoid the client and broker to become desynchronized in case of request timeouts. NOTE: The connection is automatically re-established. <br>*Type: integer*
3131
broker.address.ttl | * | 0 .. 86400000 | 1000 | low | How long to cache the broker address resolving results (milliseconds). <br>*Type: integer*
3232
broker.address.family | * | any, v4, v6 | any | low | Allowed broker IP address families: any, v4, v6 <br>*Type: enum value*

Diff for: src/rdkafka_conf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
555555
#endif
556556
},
557557
{_RK_GLOBAL, "socket.nagle.disable", _RK_C_BOOL, _RK(socket_nagle_disable),
558-
"Disable the Nagle algorithm (TCP_NODELAY) on broker sockets.", 0, 1, 0
558+
"Disable the Nagle algorithm (TCP_NODELAY) on broker sockets.", 0, 1, 1
559559
#ifndef TCP_NODELAY
560560
,
561561
.unsupported = "TCP_NODELAY not available at build time"

0 commit comments

Comments
 (0)