Every client accept takes the connection tracker locks
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
Start by reading ConnectionTracker::is_client_exempt(), ConnectionTracker::obtain_inbound(), Group::release(), and handle_max_client_connections() to trace the accept and close paths. The issue lists several possible changes but gives no measured lock cost or chosen behavior; first measure the contention and assess how skipping table lookups affects get_connection_tracker_info and the exempt connection counters.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Every TCP client accept takes two locks in ConnectionTracker, whatever the configuration:
- The shared lock on the client exempt list (
client_exempt_list_mutex), inConnectionTracker::is_client_exempt(). The accept takes it even whenproxy.config.http.per_client.connection.exempt_listis empty. - For a client that is not in the exempt list, the exclusive mutex on the inbound table (
_inbound_table._mutex), inConnectionTracker::obtain_inbound(). The accept finds or creates aGroupfor the client address. When the last connection from that address closes,Group::release()takes the same mutex again to erase theGroup.
The accept takes the second lock even when proxy.config.net.per_client.max_connections_in is 0, which means no limit. NetHandler::get_per_client_max_connections_in() maps 0 to INT32_MAX - 1, so the client_max > 0 check in handle_max_client_connections() always passes. This has been the case since #10688. #13737 kept the same locks for accepted connections. Connections that proxy.config.net.connections_throttle refuses now also take the shared lock, because the exempt-list lookup happens before the throttle check.
The inbound table mutex is one mutex for all accept threads. A client that opens one connection at a time takes it twice per connection and allocates a new Group each time.
Possible changes:
- Skip the inbound table when
max_connections_inis 0. Theget_connection_tracker_infoJSONRPC method reports the inbound table, so with no limit set, clients would no longer appear in its output. - Skip the exempt-list lock when the list is empty, or keep the list as an immutable snapshot that a reload or a plugin API edit replaces, so that readers take no lock.
- Together with the first change, look up the exempt list only when the per-client limit is set or the connection count is at
connections_throttle.proxy.process.net.per_client.connections_exempt_inandproxy.process.net.per_client.connections_exempt_currently_openwould then count only the connections that a limit applied to.
The cost of these locks has not been measured.
- Ngôn ngữ chính
- C++
- Star
- 2k
- Fork
- 882
- Merge trung bình
- 3 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 113
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/trafficserver
-
Bug Metrics
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
apache/trafficserver#13940 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
WebSocket upgrade to an HTTP/2 origin is sent as a plain GETCó thể đã có người làm @bryancall đã nhận 3 ngày trước. Đang mởBug HTTP/2 Websockets
apache/trafficserver#13920 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Branch build clones: mirror stalls, clone timeout and controller memoryCó thể đã có người làm @bryancall đã nhận 15 ngày trước. Đang mởCI
apache/trafficserver#13839 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
traffic_ctl: apply --error-level to config reload resultsCó thể đã có người làm @brbzull0 đã nhận 17 ngày trước. Đang mởtraffic_ctl
apache/trafficserver#13832 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
header_rewrite: rm-destination after set-destination URL crashes traffic_serverCó thể đã có người làm @moonchen đã nhận 24 ngày trước. Đang mởBug Crash header_rewrite Plugins
apache/trafficserver#13800 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/trafficserver
Issue tương tự
-
good first issue invalid
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
DanielJerolm/gpcc#74 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
patrick-hudson/put.gd-desktop#808 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DPI change is not fully handled in the cascading window on WindowsCó thể đã có người làm @yukawa đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement Ready for final check
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
mpogue2/SquareDesk#1818 · 1 bình luận ·