Every client accept takes the connection tracker locks
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- backend, performance
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 2k
- Fork
- 882
- Merge medio
- 3g 19h
- PR unite (30g)
- 113
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/trafficserver
-
Bug Metrics
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
apache/trafficserver#13940 ·
I maintainer di solito rispondono entro 2 giorni
-
WebSocket upgrade to an HTTP/2 origin is sent as a plain GETForse già presa @bryancall l’ha presa 3 giorni fa. ApertaBug HTTP/2 Websockets
apache/trafficserver#13920 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Branch build clones: mirror stalls, clone timeout and controller memoryForse già presa @bryancall l’ha presa 15 giorni fa. ApertaCI
apache/trafficserver#13839 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
traffic_ctl: apply --error-level to config reload resultsForse già presa @brbzull0 l’ha presa 17 giorni fa. Apertatraffic_ctl
apache/trafficserver#13832 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
header_rewrite: rm-destination after set-destination URL crashes traffic_serverForse già presa @moonchen l’ha presa 24 giorni fa. ApertaBug Crash header_rewrite Plugins
apache/trafficserver#13800 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/trafficserver
Issue simili
-
good first issue invalid
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
DanielJerolm/gpcc#74 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
patrick-hudson/put.gd-desktop#808 ·
I maintainer di solito rispondono entro 1 giorno
-
DPI change is not fully handled in the cascading window on WindowsForse già presa @yukawa l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
dasher-project/Dasher-GTK#97 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno