Files
cloudron-box/migrations/20240410125743-apps-rename-cpuShares-to-cpuQuota.js
Girish Ramakrishnan b4e4f26361 Rework cpuShares into cpuQuota
cpuShares is the relative weight wrt other apps. This is used when
there is contention for CPU. If we want this, maybe we implement
a UI where we show all the apps and let the user re-order them.
As it stands, it is confusing.

cpuQuota is a more straightforward "hard limit" of the CPU% that you
want the app to consume.

Can be tested with : stress -c 8 -t 20s
2024-04-10 18:25:14 +02:00

11 lines
313 B
JavaScript

'use strict';
exports.up = async function (db) {
await db.runSql('ALTER TABLE apps RENAME COLUMN cpuShares to cpuQuota');
await db.runSql('ALTER TABLE apps MODIFY COLUMN cpuQuota INTEGER DEFAULT 100');
await db.runSql('UPDATE apps SET cpuQuota=?', [ 100 ]);
};
exports.down = async function () {
};