Skip to content

Commit

Permalink
swapped out native "keep-alive" agent for "agentkeepalive" lib
Browse files Browse the repository at this point in the history
kept getting "No Living Connections" error under heavy load
from this issue elastic#196 learned that using "agentkeepalive" is a working alternative
  • Loading branch information
Ryan Rogers committed Oct 9, 2015
1 parent 6a78975 commit 7b65d35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"agentkeepalive": "^2.0.3",
"bluebird": "^2.9.14",
"chalk": "^1.0.0",
"forever-agent": "^0.6.0",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/connectors/_keep_alive_agent.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var ForeverAgent = require('forever-agent');
var ForeverSSLAgent = require('forever-agent').SSL;

var NativeAgent = require('http').Agent;
var NativeSSLAgent = require('https').Agent;
var NativeAgent = require('agentkeepalive');
var NativeSSLAgent = require('agentkeepalive').HttpsAgent;

var inherits = require('util').inherits;
var nativeKeepAlive = (function () {
Expand Down Expand Up @@ -45,4 +45,4 @@ if (nativeKeepAlive) {
module.exports.SSL = WrapForeverSSLAgent;
}

module.exports.supportsNativeKeepAlive = nativeKeepAlive;
module.exports.supportsNativeKeepAlive = nativeKeepAlive;

0 comments on commit 7b65d35

Please sign in to comment.