Use a single memoryLimit instead of memory and memorySwap
We will make the percent allocation dynamic depending on the system. When we have servers with a large amount of RAM but little swap, we seem to use a lot of swap because of 50% allocation strategy. In such systems, we run out of swap and thus have OOM errors even though there is a lot of RAM available!
This commit is contained in:
@@ -451,11 +451,6 @@ function getPlatformConfig(callback) {
|
||||
function setPlatformConfig(platformConfig, callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
for (let addon of [ 'mysql', 'postgresql', 'mail', 'mongodb' ]) {
|
||||
if (!platformConfig[addon]) continue;
|
||||
if (platformConfig[addon].memorySwap < platformConfig[addon].memory) return callback(new BoxError(BoxError.BAD_FIELD, 'memorySwap must be larger than memory', { field: 'memory', addon }));
|
||||
}
|
||||
|
||||
settingsdb.set(exports.PLATFORM_CONFIG_KEY, JSON.stringify(platformConfig), function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user