From 5ff3341636136e0c8675db7c1fa529d9b06f9b6a Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Wed, 26 Feb 2014 12:35:16 -0700 Subject: [PATCH] Actually pass the minSockets config to the Agent, it's only used by forever-agent but doesn't hurt passing it to http.Agent --- src/lib/connectors/http.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/connectors/http.js b/src/lib/connectors/http.js index 477f824fe..8026e7921 100644 --- a/src/lib/connectors/http.js +++ b/src/lib/connectors/http.js @@ -36,7 +36,9 @@ function HttpConnector(host, config) { config = _.defaults(config || {}, { keepAlive: true, minSockets: 10, - maxSockets: 10 + // 10 makes sense but 11 actually keeps 10 sockets around + // https://github.com/mikeal/forever-agent/issues/8 + maxSockets: 11 }); var Agent = this.hand.Agent; // the class @@ -50,7 +52,8 @@ function HttpConnector(host, config) { } this.agent = new Agent({ - maxSockets: config.maxSockets + maxSockets: config.maxSockets, + minSockets: config.minSockets }); } _.inherits(HttpConnector, ConnectionAbstract);