VPN Server TCP Optimizer for 3x-ui/Xray/WebSocket
Optimizes TCP connections on 1 CPU / 1GB RAM Ubuntu servers running 3x-ui panel.
What it does:
- Enables BBR congestion control
- Reduces TIME_WAIT connections (main bottleneck for WebSocket)
- Tunes TCP buffers for low-memory servers
- Sets ulimit to 500000 open files
- Optimizes x-ui systemd service
- Clears memory cache
Usage: sudo bash opt.bash
Tested on: Ubuntu 24/26 | Xray v26+ | 3x-ui v2.9+
Download and run directly:
sudo bash <(curl -fsSL https://raw.githubusercontent.com/3ecurityy/optimize/main/opt.bash)Or clone and run:
git clone https://github.com/3ecurityy/optimize.git
cd optimize
sudo bash opt.bashRun as root. After completion, reboot the server:
sudo reboot