php / php/php-src

New config to adjust timeouts between NGINX and PHP-FPM (fix PHP zombie process)

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

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

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

説明

Description

image

Hi,

I have a question that I haven't found the answer online. I made this graph to illustrate the situation. When there are many requests waiting in the backlog queue (because the workers are busy), a time desynchronization happens between NGINX and PHP-FPM.

The PHP-FPM continues getting the requests from the backlog queue even though NGINX has already answered the client with 504 response.

This is a waste of resources, as the PHP result will never reach NGINX, as NGINX has already responded to the request with 504 to the client

When this happens the new requests receives a timeout because they go to the end of the queue and are processed with delay

If there is a configuration that takes into account the time that the process spends in the backlog queue, these "zombie" processes do not even need to be processed if they have already reached the timeout limit

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

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

はじめの一歩

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

調査の方向性

Issue に記載されている PHP-FPM のバックログ処理と NGINX のタイムアウトとの相互作用の調査から始めてください。要求された設定動作が実現可能かどうかを判断し、クライアントタイムアウトをすでに超過したリクエストをどのように処理するかを定義してください。合意済みの設定設計と、検証済みのタイムアウトシナリオが決まれば完了です。

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

評価

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

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

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