mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #1288] مصرف بالای cpu #879
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#879
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 @m484r on GitHub (Dec 5, 2023).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/1288
Welcome
Description of the problem,screencshot would be good
سلام وقت بخیر

چطوری این مصرف بالای cpu رو از بین ببرم؟
من 5 تا سرور دارم ولی فقط این یکی اینطوری شده
از طرفی رو همه کانفیگ ها ip limit گذاشته بودم که سعی کردم همشو حذف کنم و fail2ban رو هم فعال کردم
کلا تمام تاپیک ها رو خوندم و انجام دادم ولی مشکل حل نشد
حتی سرور رو هم ارتقا دادم به 16 هسته ای ولی بازم بالای 70 درصد cpu در گیر میشه و xray ری استارت میشه و کندی سرعت و قطعی پیش میاد
Version of 3x-ui
x-ui log reports or xray log
@m484r commented on GitHub (Dec 7, 2023):
نه تانل هستش
سرور هم عوض کردم خوب نشده
@mehdikhody commented on GitHub (Feb 3, 2024):
After a few days, I realized that if you enable access logging, the xray core indefinitely adds logs to the
access.logfile, and after a day or two, the file size becomes excessively large.github.com/XTLS/Xray-core@ad3d347cfc/common/log/logger.go (L164)For Developers
There is a memory leak when the panel tries to load the entire file initially, resulting in a significant consumption of RAM and processing power. If the log file is very large, using
ReadFileto read the entire file into memory at once can potentially lead to memory issues, including running out of memory or causing excessive memory consumption. It's important to be mindful of memory usage, especially when dealing with large files. If the file size is too large to fit comfortably in memory, consider reading the file in chunks usingOpenandfile.Readto process the data incrementally.github.com/MHSanaei/3x-ui@f0e9aa0b8f/web/job/check_client_ip_job.go (L100)github.com/MHSanaei/3x-ui@f0e9aa0b8f/web/job/check_client_ip_job.go (L154)For Consoomers
✅ To resolve the issue, periodically delete the
access.logfile or remove it entirely from the settings.https://xtls.github.io/en/config/log.html#logobject
💯 You should choose between limiting user IPs or prioritizing server performance and speed. Additionally, I have tested the IP limitation, and it is not very accurate. Therefore, it is better to disable it for the sake of performance.
@MHSanaei commented on GitHub (Feb 3, 2024):
اگر ای پی لیمیت فعال باشه و شما access log و fail2ban نصب نداشته باشید cpu بالا میره
داخل logsهم میتونید warning هارو ببینید
راه حل هم اینه یا موارد لازم رو نصب و اضافه کنید یا ای پی لیمیت رو غیرفعال کنید
@mehdikhody commented on GitHub (Feb 3, 2024):
تمامی موارد نصب شده اما من همچنان این مشکل را داشتم و تصمیم گرفتم کلا از این ویژگی استفاده نکنم.