diff --git a/CHANGES b/CHANGES index 511712ef8..b04467b1a 100644 --- a/CHANGES +++ b/CHANGES @@ -1221,4 +1221,5 @@ * Merge multi-string DKIM records * scheduler: do not start cron jobs all at once * scheduler: give cron jobs a grace period of 30 minutes to complete +* scheduler: tasks are now allocated twice the app memory limit diff --git a/src/docker.js b/src/docker.js index f7ac6da7b..98670c066 100644 --- a/src/docker.js +++ b/src/docker.js @@ -163,6 +163,10 @@ function createSubcontainer(app, name, cmd, options, callback) { memoryLimit = constants.DEFAULT_MEMORY_LIMIT; } + // give scheduler tasks twice the memory limit since background jobs take more memory + // if required, we can make this a manifest and runtime argument later + if (!isAppContainer) memoryLimit *= 2; + // apparmor is disabled on few servers var enableSecurityOpt = config.CLOUDRON && safe(function () { return child_process.spawnSync('aa-enabled').status === 0; }, false);