From c6615f0ab5d8dc63c7af7babbe00a35011ca7b98 Mon Sep 17 00:00:00 2001 From: aaaamoooo Date: Tue, 20 Oct 2026 06:25:37 +0000 Subject: [PATCH] fix: systemd agent unit add --max-semi-space-size=4 (match run.sh); README memory numbers to measured values --- README.md | 10 +++++----- systemd/nexusgate-agent.service | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 01a85b5..fc5fbfd 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ - 3x-ui 式共享节点:nodes 状态机 + 每个客户独立凭据(`ng:` 身份) - 全面 sing-box:不再捆绑 xray - 按用户流量统计:AnyTLS 走日志解析,SS 走节点级 -- 内存优化:面板 `node --max-old-space-size=128`,agent 64M,sing-box `GOMEMLIMIT=64MiB` +- 内存优化:面板 `node --max-old-space-size=128 --optimize-for-size`,agent `--max-old-space-size=64 --optimize-for-size --max-semi-space-size=4`,sing-box `GOMEMLIMIT=64MiB GOGC=50` ## 安装 @@ -46,13 +46,13 @@ curl -fsSL https://raw.githubusercontent.com/aaaamoooo/NexusGate/main/scripts/ag VLESS / SS2022 / SS经典 / SOCKS5 / Hysteria2 / AnyTLS -## 内存占用(实测) +## 内存占用(实测 2026-10-20,三台节点机) | 组件 | 内存 | |---|---| -| 主控面板 | 约 61MB | -| Agent | 约 30MB | -| sing-box | 约 64MB | +| 主控面板 | 约 61MB(OpenWrt 路由器) | +| Agent | 57–82MB(含 Node 运行时;客户/流量越多越高) | +| sing-box | 16–36MB | ## License diff --git a/systemd/nexusgate-agent.service b/systemd/nexusgate-agent.service index 1b334c5..8dc37ff 100644 --- a/systemd/nexusgate-agent.service +++ b/systemd/nexusgate-agent.service @@ -6,7 +6,7 @@ Wants=network-online.target [Service] Type=simple EnvironmentFile=/etc/nexusgate/agent.env -ExecStart=/usr/bin/node --max-old-space-size=64 --optimize-for-size /opt/nexusgate-agent/agent.js +ExecStart=/usr/bin/node --max-old-space-size=64 --optimize-for-size --max-semi-space-size=4 /opt/nexusgate-agent/agent.js Restart=always RestartSec=5 NoNewPrivileges=true