From 8b5d55fecd70d8985f8de237718f0eb70680f0b2 Mon Sep 17 00:00:00 2001 From: Bryce Baril Date: Thu, 10 Jul 2014 21:18:47 -0700 Subject: [PATCH] Set socket_keepalive to default to `true` --- README.md | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e9a94eae0..2d5d1238a0 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ every command on a client. * `socket_nodelay`: defaults to `true`. Whether to call setNoDelay() on the TCP stream, which disables the Nagle algorithm on the underlying socket. Setting this option to `false` can result in additional throughput at the cost of more latency. Most applications will want this set to `true`. -* `socket_keepalive` defaults to `false`. Whether the keep-alive functionality is enabled on the underlying socket. +* `socket_keepalive` defaults to `true`. Whether the keep-alive functionality is enabled on the underlying socket. * `no_ready_check`: defaults to `false`. When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server not respond to any commands. To work around this, `node_redis` has a "ready check" which sends the `INFO` command to the server. The response from the `INFO` command diff --git a/index.js b/index.js index f7209c106d..38a6084e26 100644 --- a/index.js +++ b/index.js @@ -44,7 +44,7 @@ function RedisClient(stream, options) { this.options.socket_nodelay = true; } if (this.options.socket_keepalive === undefined) { - this.options.socket_keepalive = false; + this.options.socket_keepalive = true; } this.should_buffer = false; this.command_queue_high_water = this.options.command_queue_high_water || 1000;