From 8e2cd57cb934686b66db0c6eee617ab64b60f52f Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Mon, 21 Jun 2021 15:18:51 +0100 Subject: [PATCH] very basic mvp for shedding load When the box is over 100% capacity start to shed load. Use 5 min load average to make the system less likely to start moving projects off after a temporary cpu spike --- services/clsi/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/clsi/app.js b/services/clsi/app.js index 8dd8a8cbf3..b2c261bc2e 100644 --- a/services/clsi/app.js +++ b/services/clsi/app.js @@ -331,7 +331,7 @@ const loadTcpServer = net.createServer(function (socket) { const freeLoad = availableWorkingCpus - currentLoad let freeLoadPercentage = Math.round((freeLoad / availableWorkingCpus) * 100) if (freeLoadPercentage <= 0) { - freeLoadPercentage = 1 // when its 0 the server is set to drain and will move projects to different servers + freeLoadPercentage = 0 // when its 0 the server is set to drain and will move projects to different servers } socket.write(`up, ${freeLoadPercentage}%\n`, 'ASCII') return socket.end()