[PR #5206] [CLOSED] feat: comprehensive system optimization and auto swap deployment #5817

Closed
opened 2026-11-02 04:04:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5206
Author: @rqzbeh
Created: 6/11/2026
Status: ❌ Closed

Base: main ← Head: rewrite-5186


📝 Commits (2)

  • 2a159c1 feat: comprehensive system optimization and auto swap deployment
  • ce78bdc Merge branch 'main' into rewrite-5186

📊 Changes

1 file changed (+206 additions, -57 deletions)

View changed files

📝 x-ui.sh (+206 -57)

📄 Description

Summary

This PR replaces the singular BBR toggle in x-ui.sh with a comprehensive system optimization menu that configures memory swap scaling, multi-core interrupts, file descriptor limits, and tailored network proxy stack optimizations.

Why

Users running high-performance proxies (VLESS, XHTTP, WireGuard, Hysteria2) require more than just enabling BBR. This scales the underlying OS limits optimally for heavy traffic without manual configuration. It auto-deploys mathematically optimal swap partitions (avoiding Docker limitations natively) to prevent OOM errors and scales UDP/TCP limits to support maximum inbound throughput correctly.

Additionally, this PR heavily configures TCP semantics specifically targeted to increase resiliency against severe DPI (Deep Packet Inspection) environments commonly found in Iran/China/Russia, without sacrificing raw performance.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

  • Navigated into the x-ui CLI menu via bash and verified System Optimization appears.
  • Attempted to apply configurations. Checked that /swapfile, irqbalance, /etc/sysctl.d/99-xui-optimization.conf and /etc/security/limits.d limits correctly propagate based on OS capabilities.
  • Checked Docker simulation edge cases using $XUI_IN_DOCKER environment variable logic to verify skipping unsupported swap deployments gracefully.

Screenshots / recordings

None.

Breaking changes

None. BBR users can remove the previous BBR logic via the cleanup functions automatically integrated into the updated optimization disabling sequence.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5206 **Author:** [@rqzbeh](https://github.com/rqzbeh) **Created:** 6/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `rewrite-5186` --- ### 📝 Commits (2) - [`2a159c1`](https://github.com/MHSanaei/3x-ui/commit/2a159c1630d3389970e24f90a9ef1e9eb289acb5) feat: comprehensive system optimization and auto swap deployment - [`ce78bdc`](https://github.com/MHSanaei/3x-ui/commit/ce78bdcad44f393db532d613822bc9e512fcd1b8) Merge branch 'main' into rewrite-5186 ### 📊 Changes **1 file changed** (+206 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `x-ui.sh` (+206 -57) </details> ### 📄 Description ## Summary This PR replaces the singular BBR toggle in `x-ui.sh` with a comprehensive system optimization menu that configures memory swap scaling, multi-core interrupts, file descriptor limits, and tailored network proxy stack optimizations. ## Why Users running high-performance proxies (VLESS, XHTTP, WireGuard, Hysteria2) require more than just enabling BBR. This scales the underlying OS limits optimally for heavy traffic without manual configuration. It auto-deploys mathematically optimal swap partitions (avoiding Docker limitations natively) to prevent OOM errors and scales UDP/TCP limits to support maximum inbound throughput correctly. Additionally, this PR heavily configures TCP semantics specifically targeted to **increase resiliency against severe DPI (Deep Packet Inspection) environments** commonly found in Iran/China/Russia, without sacrificing raw performance. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [ ] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [x] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? - Navigated into the `x-ui` CLI menu via bash and verified `System Optimization` appears. - Attempted to apply configurations. Checked that `/swapfile`, `irqbalance`, `/etc/sysctl.d/99-xui-optimization.conf` and `/etc/security/limits.d` limits correctly propagate based on OS capabilities. - Checked Docker simulation edge cases using `$XUI_IN_DOCKER` environment variable logic to verify skipping unsupported swap deployments gracefully. ## Screenshots / recordings None. ## Breaking changes None. BBR users can remove the previous BBR logic via the cleanup functions automatically integrated into the updated optimization disabling sequence. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:04:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5817
No description provided.