fix(runtime): 턴 데몬 전용 heap 상한을 추가

공용 빌드·API heap과 턴 데몬 heap을 분리하고 Compose 안전 검증과 운영 문서를 함께 갱신한다.
This commit is contained in:
2026-08-16 06:48:42 +00:00
parent a7c7204915
commit 1d25540b1a
5 changed files with 21 additions and 3 deletions
+9
View File
@@ -56,6 +56,15 @@ export const validateComposeModel = (model, mode) => {
if (!heapMatch || heapMiB < 512 || heapMiB > 2048) {
errors.push('runtime Node heap limit must be between 512 and 2048 MiB');
}
const turnDaemonNodeOptions = runtime.environment?.TURN_DAEMON_NODE_OPTIONS ?? '';
const turnDaemonHeapMatch = /(?:^|\s)--max-old-space-size=(\d+)(?:\s|$)/.exec(turnDaemonNodeOptions);
const turnDaemonHeapMiB = Number(turnDaemonHeapMatch?.[1] ?? 0);
if (!turnDaemonHeapMatch || turnDaemonHeapMiB < 512 || turnDaemonHeapMiB > 4096) {
errors.push('turn daemon Node heap limit must be between 512 and 4096 MiB');
}
if (turnDaemonHeapMiB * 1024 * 1024 >= Number(runtime.mem_limit)) {
errors.push('turn daemon Node heap limit must stay below the runtime memory limit');
}
const rayonThreads = Number(runtime.environment?.RAYON_NUM_THREADS ?? 0);
if (!Number.isInteger(rayonThreads) || rayonThreads < 1 || rayonThreads > 4) {
errors.push('runtime Rayon thread count must be between 1 and 4');