php / php/php-src

FPM improve listen queue status info

Offen
#9,943 3 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Feature SAPI: fpm
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, nachzuverfolgen, wie FPM den Status der Listen-Warteschlange derzeit über tcp_info ermittelt, und vergleiche anschließend den Linux-netlink-sock_diag-Ansatz mit den Optionen SO_LISTENQLIMIT, SO_LISTENQLEN und SO_LISTENINCQLEN von FreeBSD. Als abgeschlossen gilt die korrekte Ermittlung des Listen-Warteschlangenstatus für inet- und Unix-Domain-Sockets, ohne eine verpflichtende libnl-Abhängigkeit vorauszusetzen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c
Bereich
networking
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.