allocate swap size for containers based on system ratio

This commit is contained in:
Girish Ramakrishnan
2021-01-20 11:45:04 -08:00
parent 7b24239d38
commit 0d535d2d5c
3 changed files with 21 additions and 8 deletions

View File

@@ -45,6 +45,7 @@ var addons = require('./addons.js'),
settings = require('./settings.js'),
shell = require('./shell.js'),
safe = require('safetydance'),
system = require('./system.js'),
util = require('util'),
volumes = require('./volumes.js'),
_ = require('underscore');
@@ -313,7 +314,7 @@ function createSubcontainer(app, name, cmd, options, callback) {
'syslog-format': 'rfc5424'
}
},
Memory: memoryLimit / 2,
Memory: system.getMemoryAllocation(memoryLimit),
MemorySwap: memoryLimit, // Memory + Swap
PortBindings: isAppContainer ? dockerPortBindings : { },
PublishAllPorts: false,