This refactors the initial approach in PR #7281, replacing the UsagePool with a dedicated package-level sync.Map and atomic.Int64 to track in-flight requests without global lock contention. It also introduces a lookup map in the admin API to fix a potential O(n^2) iteration over upstreams, ensuring that draining upstreams are correctly exposed across config reloads without leaking memory. Co-authored-by: Y.Horie <u5.horie@gmail.com> reverseproxy: optimize in-flight tracking and admin API - Replaced sync.RWMutex with sync.Map and atomic.Int64 to avoid lock contention under high RPS. - Introduced a lookup map in the admin API to fix a potential O(n^2) iteration over upstreams. |
||
|---|---|---|
| .. | ||
| fastcgi | ||
| forwardauth | ||
| addresses.go | ||
| addresses_test.go | ||
| admin.go | ||
| ascii.go | ||
| ascii_test.go | ||
| buffering_test.go | ||
| caddyfile.go | ||
| command.go | ||
| copyresponse.go | ||
| headers_test.go | ||
| healthchecks.go | ||
| hosts.go | ||
| httptransport.go | ||
| httptransport_test.go | ||
| metrics.go | ||
| reverseproxy.go | ||
| selectionpolicies.go | ||
| selectionpolicies_test.go | ||
| streaming.go | ||
| streaming_test.go | ||
| upstreams.go | ||
| upstreams_test.go | ||