From 0dc80ff14447e54cf9ca32b10841d553833865c1 Mon Sep 17 00:00:00 2001 From: Joywayer Date: Thu, 6 Aug 2026 17:17:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(vps-xray):=20=E5=88=A0=E9=99=A4=E6=97=A7?= =?UTF-8?q?=E7=9A=84=E6=AF=8F=E6=97=A5=E9=87=8D=E5=90=AF=E5=B0=8F=E8=8A=82?= =?UTF-8?q?=EF=BC=8C=E8=A1=A5=E5=85=85=E6=96=B0=E5=B0=8F=E8=8A=82=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E5=A4=B1=E7=90=86=E7=94=B1=EF=BC=9B=E6=9B=B4?= =?UTF-8?q?=E6=96=B0uninstall=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vps-xray/README.md | 24 +++++++----------------- vps-xray/uninstall.sh | 2 +- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/vps-xray/README.md b/vps-xray/README.md index 4594268..05906ea 100644 --- a/vps-xray/README.md +++ b/vps-xray/README.md @@ -195,7 +195,13 @@ xray tls ping www.apple.com # 只看「Pinging with SNI」那一段 ### 定时重启 -默认**关闭**。崩溃恢复已由 systemd 的 `Restart=always` + `RestartSec=3` 覆盖(秒级响应),而硬重启会切断全部活动连接——跨夜下载、备份、CI 都会中断。仅在确实观察到长期运行后性能退化时才启用。 +默认**关闭**。原因是: + +- 崩溃恢复已由 systemd 的 `Restart=always` + `RestartSec=3` 覆盖(秒级响应),不必等到凌晨 +- Xray 无已知需要定期重启的缺陷(内存、句柄上限均已配置) +- 而硬重启会切断全部活动连接——跨夜下载、备份、CI 都会中断 + +即"为假想问题付出真实代价"。仅在确实观察到长期运行后性能退化时才启用。 需要时用轻量入口调整,**不会重装 Xray、不会重写配置、不会重启服务,现有 vless 链接完全不受影响**: @@ -281,22 +287,6 @@ bash <(curl -fsSL https://raw.githubusercontent.com/XTLS/Xray-install/main/insta systemctl restart xray ``` -### 每日自动重启(默认关闭) - -早期版本会安装一个每天 04:00 重启 Xray 的 systemd timer,现已**默认关闭**: - -- 崩溃恢复已由 `Restart=always` + `RestartSec=3` 覆盖,响应是秒级,不必等到凌晨 -- Xray 无已知需要定期重启的缺陷(内存、句柄上限均已配置) -- 而每日硬重启会**切断全部活动连接**,跨夜下载、备份、CI 都会中断 - -即"为假想问题付出真实代价"。部署时会自动移除旧版本遗留的 timer。 - -确有需要(例如实测到长期运行后性能退化)时在 `.env` 中开启: - -```bash -XRAY_DAILY_RESTART=true -``` - ### 重启 / 停止 ```bash diff --git a/vps-xray/uninstall.sh b/vps-xray/uninstall.sh index f8f373b..e9191a6 100644 --- a/vps-xray/uninstall.sh +++ b/vps-xray/uninstall.sh @@ -91,7 +91,7 @@ if [ -f /etc/systemd/system/xray-restart.timer ] \ /etc/systemd/system/xray-restart.service \ /usr/local/bin/xray-restart-guard \ /var/lib/xray/last-restart - log "已移除每日重启 timer" + log "已移除定时重启 timer 与状态文件" fi # ===== 2. 卸载 Xray =====