Просмотр исходного кода

Set maxSockets to Infinity for all services

James Allen 11 лет назад
Родитель
Сommit
738363a6de
2 измененных файлов с 7 добавлено и 1 удалено
  1. 6 0
      libraries/metrics/open_sockets.coffee
  2. 1 1
      libraries/metrics/package.json

+ 6 - 0
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 () ->

+ 1 - 1
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",