php / php/php-src

PHP_FCGI_MAX_IDLE_TIMEOUT environment variabile option for php-cgi

オープン
#13,533 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Feature SAPI: cgi
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ソースファイルやテストが指定されていないため、まず php-cgi FastCGI プロセスのライフサイクルと既存の PHP_FCGI_MAX_REQUESTS オプションを確認します。アイドルタイムアウトをどのように設定および測定するかを定義し、その後、アイドル状態のプロセスが終了する一方で、リクエストを受信しているプロセスはアクティブなままであることを示すテストカバレッジを追加します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c
領域
backend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。