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:
Girish Ramakrishnan
2021-01-19 19:05:35 -08:00
parent 24db6630ee
commit 025eb18411
5 changed files with 64 additions and 26 deletions

View File

@@ -38,12 +38,10 @@ function get(req, res, next) {
function configure(req, res, next) {
assert.strictEqual(typeof req.params.service, 'string');
if (typeof req.body.memory !== 'number') return next(new HttpError(400, 'memory must be a number'));
if (typeof req.body.memorySwap !== 'number') return next(new HttpError(400, 'memorySwap must be a number'));
if (typeof req.body.memoryLimit !== 'number') return next(new HttpError(400, 'memoryLimit must be a number'));
const data = {
memory: req.body.memory,
memorySwap: req.body.memorySwap
memory: req.body.memoryLimit
};
if (req.params.service === 'sftp') {