mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #3350] 100% CPU load #2272
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#2272
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frps on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3350
Describe the bug
Rapberry Pi 5, DietPi v9.15.2, 3X-UI v2.6.6, XRay v25.8.3
Problem: very high CPU load on all four cores
typical logs:
2025/08/11 16:27:59.244991 from 127.0.0.1:60997 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.252596 from 127.0.0.1:33767 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.668873 from 127.0.0.1:41543 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.679772 from 127.0.0.1:60873 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.687014 from 127.0.0.1:60949 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.694216 from 127.0.0.1:60983 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.701401 from 127.0.0.1:33039 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.708640 from 127.0.0.1:33161 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:27:59.721177 from 127.0.0.1:60981 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:28:00.131122 from 127.0.0.1:42660 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:28:00.140420 from 127.0.0.1:52167 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:28:00.149209 from 127.0.0.1:60929 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:28:00.156360 from 127.0.0.1:33391 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:28:00.163984 from 127.0.0.1:36183 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:28:00.171170 from 127.0.0.1:37167 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/11 16:28:00.178958 from 127.0.0.1:41255 accepted tcp:127.0.0.1:62789 [api -> direct]
2025/08/10 23:23:46 INFO - XRAY: [1290410501] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1290410501] app/dispatcher: taking detour [direct] for [tcp:127.0.0.1:62789]
2025/08/10 23:23:46 INFO - XRAY: [2355474470] proxy: CopyRawConn splice
2025/08/10 23:23:46 INFO - XRAY: [1290410501] proxy/dokodemo: received request for 127.0.0.1:56327
2025/08/10 23:23:46 INFO - XRAY: [2355474470] proxy/freedom: connection opened to tcp:127.0.0.1:62789, local endpoint 127.0.0.1:56327, remote endpoint 127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1945980092] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1945980092] app/dispatcher: taking detour [direct] for [tcp:127.0.0.1:62789]
2025/08/10 23:23:46 INFO - XRAY: [1493983508] proxy: CopyRawConn splice
2025/08/10 23:23:46 INFO - XRAY: [1945980092] proxy/dokodemo: received request for 127.0.0.1:50663
2025/08/10 23:23:46 INFO - XRAY: [1493983508] proxy/freedom: connection opened to tcp:127.0.0.1:62789, local endpoint 127.0.0.1:50663, remote endpoint 127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1493983508] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [2355474470] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1493983508] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [2355474470] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1493983508] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1493983508] app/dispatcher: taking detour [direct] for [tcp:127.0.0.1:62789]
2025/08/10 23:23:46 INFO - XRAY: [3732363518] proxy: CopyRawConn splice
2025/08/10 23:23:46 INFO - XRAY: [3732363518] proxy/freedom: connection opened to tcp:127.0.0.1:62789, local endpoint 127.0.0.1:59367, remote endpoint 127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [1493983508] proxy/dokodemo: received request for 127.0.0.1:59367
2025/08/10 23:23:46 INFO - XRAY: [2355474470] transport/internet/tcp: dialing TCP to tcp:127.0.0.1:62789
2025/08/10 23:23:46 INFO - XRAY: [2355474470] app/dispatcher: taking detour [direct] for [tcp:127.0.0.1:62789]
htop:
0[||||||||||||||||||||||||||||||||||||||100.0%] Mem[||||||||||||||||||||||||||| 1.84G/3.96G]
1[||||||||||||||||||||||||||||||||||||||100.0%] Swp[ 0K/0K]
2[|||||||||||||||||||||||||||||||||||||||98.7%] Tasks: 13, 36 thr, 116 kthr; 4 running
3[||||||||||||||||||||||||||||||||||||||100.0%] Load average: 3.32 0.81 0.31
Avg[|||||||||||||||||||||||||||||||||||||||99.7%] Uptime: 00:16:04
[Main] [I/O]
PID△USER RES NI CPU% TIME+ Command
1 root 10832 0 0.0 0:00.27 /sbin/init
147 root 10704 0 3.3 0:07.21 ├─ /lib/systemd/systemd-journald
178 root 5712 0 0.0 0:00.05 ├─ /lib/systemd/systemd-udevd
344 root 2192 0 0.0 0:00.00 ├─ /usr/sbin/cron -f
493 *** 76496 0 141.1 0:56.22 ├─ /usr/local/x-ui/x-ui
1329 *** 1373M 0 254.2 1:37.69 │ └─ bin/xray-linux-arm64 -c bin/config.json
494 nobody 24736 0 0.0 0:00.06 ├─ /usr/local/bin/xray run -config /usr/local/etc/xray/c
495 root 1616 0 0.0 0:00.00 ├─ /sbin/agetty -o -p -- \u --noclear - linux
505 root 8416 0 0.0 0:00.01 └─ sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startu
1275 root 10208 0 0.0 0:00.20 └─ sshd: root@pts/1
1281 root 1584 0 0.0 0:00.00 ├─ /usr/lib/openssh/sftp-server
1306 root 5248 0 0.0 0:00.02 └─ -bash
1354 root 3136 0 0.0 0:00.06 └─ htop
The problem resolved with some help from chatgpt 5
Solution:
In 3X-UI panel (Xray Configs -> Advanced) you should add two rules to routing section
"routing": {
"rules": [
.........
{
"type": "field",
"inboundTag": ["api"],
"port": "62789",
"outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["api"],
"outboundTag": "direct"
}
.........
]
}
click Save and restart Xray after that
I guess you have to check the port number in your logs. I don't know is it standard port number or random one.
P. S. I see something resembling the same problem in another ticket in Persian language "Bug report : CPU Issue #3245"
with only few details provided so I decided to file a full-fledged report here.
How to repeat the problem?
Nothing special, just start the app. No inbound connections needed
Expected action
Must be very low CPU load
Received action
Very high CPU load, up to 100% on all 4 cores with no clients connected
3x-ui Version
2.6.6
Xray-core Version
25.8.3
Checklist
@MHSanaei commented on GitHub (Aug 12, 2025):
Looks like you have IP limit enabled, so turned it off because you don't have enough CPU cores for it.
@frps commented on GitHub (Aug 12, 2025):
To be honest I see no relations to IP limit here.
No one connected to the app when it goes crazy with 1000's of loop API to API connections non-stop.
It is in idle and should consume near zero CPU in this state.
Also this behavior appeared only after the app update and disappeared after fixing the configuration.
and it is not related to client connections, which were not present during the tests at all.
@MHSanaei commented on GitHub (Aug 12, 2025):
Because your log is for the access log, I said to turn it off or set the access log to none, and use the reset to default button to fix everything like the original.