mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #7055] perf(logging): aggregate disabled-client logs in Xray config generation #6623
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#6623
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/7055
Author: @HamedSanaei
Created: 11/3/2026
Status: 🔄 Open
Base:
main← Head:perf/xray-config-log-aggregation-7054📝 Commits (1)
b710c84perf(logging): aggregate disabled-client logs in Xray config generation📊 Changes
3 files changed (+210 additions, -1 deletions)
View changed files
📝
internal/web/service/xray.go(+9 -1)📝
internal/web/service/xray_config_clients_test.go(+154 -0)📝
internal/web/service/xray_config_scale_test.go(+47 -0)📄 Description
Summary
Replace per-client INFO messages during Xray configuration generation with one aggregate containing the number of excluded client entries and affected inbounds. Keep the existing filtering condition, generated configuration, traffic enforcement and runtime/restart behavior.
Why
Fixes #7054
GetXrayConfig()logged every entry rejected by the traffic-enabled lookup on every generation, including unchanged configurations. Each message also entered the panel's in-memory log buffer; moving it to DEBUG would still fill that buffer. The message described a removal even though this path only filters the generated configuration.The counters are local to each generation. A successful generation with exclusions emits one INFO summary, containing counts only; a generation with no exclusions or a failed generation emits no summary. A client attached to multiple inbounds counts once per excluded entry.
This branch starts at upstream
main(eae4725d) and contains no commits from #7012 or #7014.Type of change
Areas affected
How was this tested?
Regression tests use the existing SQLite/scale fixtures and the actual logger buffer. They cover 2,000 excluded entries across five inbounds, mixed clients, unaffected inbounds, manual disablement, shared clients, zero exclusions, repeated generations, exact complete configuration comparison, identifier privacy, and failure after filtering but before configuration generation completes. The new regression tests were run against the base implementation and failed on its per-client messages; they pass with the fix.
make test-go: passed.make verify: passed (including all 2,045 frontend tests in 222 files, generated artifacts, linters, typecheck, Go/frontend builds, Storybook build and docs OpenAPI parity).make race: passed across the full Go suite, with no detected data races.git diff --check: passed.Measured performance
Compared upstream
eae4725dwith this fix using the same benchmark and normalized 2,000-client fixture across five local VLESS inbounds, all excluded by the traffic lookup. Measurements used Linux/WSL, Go 1.27.3, an Intel i7-1185G7, and five samples of 20 generations each. The existing scale logger configuration suppresses console INFO while file logging and the in-memory buffer remain active. Fixture setup and log-volume inspection are outside the timed loop.Timing ranges overlap. These measurements quantify log volume, allocations and local elapsed time; production CPU utilization was not measured.
Reproduce on each version with the benchmark added by this PR:
Breaking changes
None. Database schema, HTTP APIs, runtime operations and node synchronization are unchanged.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass. (No frontend changes.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.