Skip to content

Commit 8b5d55f

Browse files
committed
Set socket_keepalive to default to true
1 parent 4e24f24 commit 8b5d55f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ every command on a client.
192192
* `socket_nodelay`: defaults to `true`. Whether to call setNoDelay() on the TCP stream, which disables the
193193
Nagle algorithm on the underlying socket. Setting this option to `false` can result in additional throughput at the
194194
cost of more latency. Most applications will want this set to `true`.
195-
* `socket_keepalive` defaults to `false`. Whether the keep-alive functionality is enabled on the underlying socket.
195+
* `socket_keepalive` defaults to `true`. Whether the keep-alive functionality is enabled on the underlying socket.
196196
* `no_ready_check`: defaults to `false`. When a connection is established to the Redis server, the server might still
197197
be loading the database from disk. While loading, the server not respond to any commands. To work around this,
198198
`node_redis` has a "ready check" which sends the `INFO` command to the server. The response from the `INFO` command

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function RedisClient(stream, options) {
4444
this.options.socket_nodelay = true;
4545
}
4646
if (this.options.socket_keepalive === undefined) {
47-
this.options.socket_keepalive = false;
47+
this.options.socket_keepalive = true;
4848
}
4949
this.should_buffer = false;
5050
this.command_queue_high_water = this.options.command_queue_high_water || 1000;

0 commit comments

Comments
 (0)