php / php/php-src

FPM improve listen queue status info

Aperta
#9,943 3 commenti 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Feature SAPI: fpm
Lingua principale
C
Stelle
40.4k
Fork
8.1k
Merge medio
2g 13h
PR unite (30g)
96

Descrizione

Description

Currently tcp_info structure is used to get information about listen queue that is then shown in FPM status. It uses tcpi_unacked (or __tcpi_unacked on FreeBSD or NetBSD) for current listen queue status value and tcpi_sacked (or __tcpi_sacked on FreeBSD or NetBSD) which is used for max listen queue and listen queue length. The queue length is however just approximation (at least on Linux) expecting that maximum is reached which is often not the case on modern Linux kernl (one of the example is a bug #76323). In addition this works only for inet socket but doesn't work for unix domain socket as mentioned in bug #80739.

The solution for this on Linux is to use netlink with sock_diag. It brings some challenges (like keeping inode number for the socket) but provides the required info and more. We could consider using libnl but that might not be a good idea as it would require an explicit non default dependency so it might not be always available (e.g. when FPM is compiled without it).

The FreeBSD should probably prefer the SO_LISTENQLIMIT, SO_LISTENQLEN and SO_LISTENINCQLEN (for UDS) to get the required info as those options are specifically meant to be used for this and tcp_info is quite undocumented there. It also can provide the info for unix domain socket as mentioned.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia tracciando il modo in cui FPM ottiene attualmente i valori della coda di ascolto tramite tcp_info, quindi confronta l’approccio Linux netlink sock_diag con le opzioni SO_LISTENQLIMIT, SO_LISTENQLEN e SO_LISTENINCQLEN di FreeBSD. Il lavoro è completo quando lo stato della coda di ascolto è accurato per i socket inet e i socket di dominio Unix, senza richiedere una dipendenza obbligatoria da libnl.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c
Ambito
networking
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.