The Invisible BottleNeck
XUI.ONE is a highly efficient, compiled application. However, even the best software cannot perform well if the underlying Operating System (Ubuntu/Debian) is configured for "desktop" usage rather than "high-performance streaming." High CPU and RAM usage often indicates that the kernel is struggling to manage thousands of open connections (files) efficiently.
1Step 1: Raise File Descriptor Limits
Every stream a user watches opens a "file" on your Linux system. Default limits are often too low (1024), causing the CPU to work overtime managing queues or the RAM to fill up with stagnant processes.
Open the security limits file:
Add the following lines to the end of the file to allow XUI (and the root user) to handle massive concurrency:
Save and exit (Ctrl+O, Enter, Ctrl+X).
2Step 2: Optimize the Network Stack (Sysctl)
This is the most critical step for reducing RAM usage. We need to tweak how the kernel handles TCP buffers and connection tracking. Improper settings here cause memory leaks and high CPU wait times.
Open the sysctl configuration:
Paste these high-performance settings at the bottom:
Apply the settings immediately:
3Step 3: Database & Service Optimization
Unlike Xtream UI, XUI.ONE is self-contained. However, restarting the service after applying kernel updates ensures the application binds to the new limits.
Restart the XUI service:
Pro Tip: If you are running a Main server and Load Balancers, apply Step 1 and Step 2 to all servers, not just the Main. Load Balancers handle the actual traffic and benefit most from the network stack tuning.
4Step 4: Verify Results
Check your new limits to ensure they are active:
It should return 1000000. Monitor your CPU usage using htop. You should see a significant reduction in "System" (red) CPU usage, which indicates the kernel is handling networking packets much more efficiently.
