Skip to content

Commit a1d56b0

Browse files
committed
fix: Remove conflicting scale-down from minInstances useEffect
The second useEffect was unconditionally scaling down servers when count exceeded minInstances, which conflicted with the CPU-based auto-scaling in the game loop. Now the useEffect only handles scaling UP to meet minimum requirements, while CPU-based scale-up and scale-down remain controlled by the game loop thresholds.
1 parent e266a21 commit a1d56b0

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

components/games/scaling-simulator.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,6 @@ export default function ScalingSimulator() {
414414
}, 500);
415415
return () => clearTimeout(timer);
416416
}
417-
418-
// Scale down if above minimum (and no load requiring extra capacity)
419-
if (healthyServers.length > scalingConfig.minInstances && healthyServers.length > 1) {
420-
const timer = setTimeout(() => {
421-
const serverToRemove = healthyServers[healthyServers.length - 1];
422-
if (serverToRemove) removeServer(serverToRemove.id);
423-
}, 500);
424-
return () => clearTimeout(timer);
425-
}
426417
}, [scalingConfig.autoScalingEnabled, scalingConfig.minInstances, hasLoadBalancer, servers, addServer, removeServer]);
427418

428419
// Reset game

0 commit comments

Comments
 (0)