Merge pull request #4306 from overleaf/jpa-http-sockets-limit

[misc] migrate setting of limit for http/https sockets into entrypoint

GitOrigin-RevId: 2ff568bf89d3175b48246db3645a91428624b31f
This commit is contained in:
Jakob Ackermann 2021-07-12 12:40:22 +02:00 committed by Copybot
parent f2be7f4909
commit b4777a8cce
2 changed files with 10 additions and 2 deletions

View file

@ -23,6 +23,11 @@ if ((Settings.sentry != null ? Settings.sentry.dsn : undefined) != null) {
logger.initializeErrorReporting(Settings.sentry.dsn)
}
const http = require('http')
const https = require('https')
http.globalAgent.maxSockets = Settings.limits.httpGlobalAgentMaxSockets
https.globalAgent.maxSockets = Settings.limits.httpsGlobalAgentMaxSockets
metrics.memory.monitor(logger)
const Server = require('./app/src/infrastructure/Server')

View file

@ -1,8 +1,6 @@
const { merge } = require('@overleaf/settings/merge')
let defaultFeatures, siteUrl
const http = require('http')
http.globalAgent.maxSockets = 300
// Make time interval config easier.
const seconds = 1000
@ -74,6 +72,11 @@ const parseTextExtensions = function (extensions) {
}
module.exports = {
limits: {
httpGlobalAgentMaxSockets: 300,
httpsGlobalAgentMaxSockets: 300,
},
allowAnonymousReadAndWriteSharing:
process.env.SHARELATEX_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING === 'true',