From 738363a6dedd78db162aa9b6b2a7dd35927b5337 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 31 Aug 2015 14:02:03 +0100 Subject: [PATCH] Set maxSockets to Infinity for all services --- libraries/metrics/open_sockets.coffee | 6 ++++++ libraries/metrics/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/metrics/open_sockets.coffee b/libraries/metrics/open_sockets.coffee index d4a6eb6c8d..9af019dfc8 100644 --- a/libraries/metrics/open_sockets.coffee +++ b/libraries/metrics/open_sockets.coffee @@ -1,6 +1,12 @@ URL = require "url" seconds = 1000 +# In Node 0.10 the default is 5, which means only 5 open connections at one. +# Node 0.12 has a default of Infinity. Make sure we have no limit set, +# regardless of Node version. +require("http").globalAgent.maxSockets = Infinity +require("https").globalAgent.maxSockets = Infinity + module.exports = OpenSocketsMonitor = monitor: (logger) -> interval = setInterval () -> diff --git a/libraries/metrics/package.json b/libraries/metrics/package.json index 69fe375357..1f5214c3d4 100644 --- a/libraries/metrics/package.json +++ b/libraries/metrics/package.json @@ -1,6 +1,6 @@ { "name": "metrics-sharelatex", - "version": "1.2.0", + "version": "1.3.0", "description": "A drop-in metrics and monitoring module for node.js apps", "repository": { "type": "git",