php / php/php-src

PHP_FCGI_MAX_IDLE_TIMEOUT environment variabile option for php-cgi

Offen
#13,533 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

Description

I'm writing an "external" multiplatform php fastcgi process manager in golang for the caddy webserver, something like php-fpm but using the php-cgi executable in fastcgi mode;

while implementing it using socket passing to be faster simpler and have zero-copy between processes

i've found that i wanted to add an option in my process manager analogous to php-fpm pm.process_idle_timeout to free memory when the server load is low and to avoid eventual memory leaks

I've thinked about how to implement this feature for a while in a way that does not require modifying php-cgi itself, but without finding a solution that allowed to keeping zero-copy socket passing.

The proposal is to add an environment variabile option that instruct php-cgi processes to self terminate after a certain amount of time if no requests are received, something like the already existing PHP_FCGI_MAX_REQUESTS that already aligns with php-fpm pm.max_requests.

Eventually having millisecond granularity unlike second granularity only like in pm.process_idle_timeout will be a plus.

That Is... Hoping i'm not missing something obviuos and that the proposal make sense.

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

Beginnen Sie mit der Überprüfung des Lebenszyklus des php-cgi-FastCGI-Prozesses und der bestehenden Option PHP_FCGI_MAX_REQUESTS, da keine Quelldatei oder kein Test genannt wird. Legen Sie fest, wie ein Leerlauf-Timeout konfiguriert und gemessen werden soll, und fügen Sie anschließend Tests hinzu, die zeigen, dass ein im Leerlauf befindlicher Prozess beendet wird, während ein Prozess, der Anfragen empfängt, aktiv bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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