Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

PHP‑FPM workers exceed pm.max_requests

未关闭
#23,122 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
php
领域
backend

调研方向

首先,在 pm.max_requests=5000 的持续负载下,使用 issue 中的 PHP-FPM 配置和 worker-status 证据,复现报告的行为。跟踪 PHP-FPM 的请求计数和 worker 回收行为;完成的标准是解释清楚该差异,并且 worker 能够在配置的限制处可靠地回收,同时覆盖所观察到的案例。

由索引模型根据 Issue 内容生成。

描述

Bug SAPI: fpm Status: Needs Triage
Description

PHP‑FPM workers consistently exceed the configured pm.max_requests value under sustained load. Even with pm.max_requests = 5000, individual workers regularly process 8000–10,000+ requests before recycling.

$ sudo php-fpm -tt
[07-Aug-2026 20:20:46] NOTICE: [global]
[07-Aug-2026 20:20:46] NOTICE:  pid = /var/run/php-fpm.pid
[07-Aug-2026 20:20:46] NOTICE:  error_log = /var/log/php-fpm/php-fpm.log
[07-Aug-2026 20:20:46] NOTICE:  syslog.ident = php-fpm
[07-Aug-2026 20:20:46] NOTICE:  syslog.facility = 24
[07-Aug-2026 20:20:46] NOTICE:  log_buffering = yes
[07-Aug-2026 20:20:46] NOTICE:  log_level = unknown value
[07-Aug-2026 20:20:46] NOTICE:  log_limit = 1024
[07-Aug-2026 20:20:46] NOTICE:  emergency_restart_interval = 60s
[07-Aug-2026 20:20:46] NOTICE:  emergency_restart_threshold = 10
[07-Aug-2026 20:20:46] NOTICE:  process_control_timeout = 10s
[07-Aug-2026 20:20:46] NOTICE:  process.max = 0
[07-Aug-2026 20:20:46] NOTICE:  process.priority = undefined
[07-Aug-2026 20:20:46] NOTICE:  daemonize = yes
[07-Aug-2026 20:20:46] NOTICE:  rlimit_files = 0
[07-Aug-2026 20:20:46] NOTICE:  rlimit_core = 0
[07-Aug-2026 20:20:46] NOTICE:  events.mechanism = kqueue
[07-Aug-2026 20:20:46] NOTICE:
[07-Aug-2026 20:20:46] NOTICE: [www]
[07-Aug-2026 20:20:46] NOTICE:  prefix = undefined
[07-Aug-2026 20:20:46] NOTICE:  user = www
[07-Aug-2026 20:20:46] NOTICE:  group = www
[07-Aug-2026 20:20:46] NOTICE:  listen = /var/run/php-fpm.sock
[07-Aug-2026 20:20:46] NOTICE:  listen.backlog = -1
[07-Aug-2026 20:20:46] NOTICE:  listen.owner = nginx
[07-Aug-2026 20:20:46] NOTICE:  listen.group = nginx
[07-Aug-2026 20:20:46] NOTICE:  listen.mode = 0660
[07-Aug-2026 20:20:46] NOTICE:  listen.allowed_clients = 127.0.0.1
[07-Aug-2026 20:20:46] NOTICE:  listen.setfib = -1
[07-Aug-2026 20:20:46] NOTICE:  process.priority = undefined
[07-Aug-2026 20:20:46] NOTICE:  process.dumpable = no
[07-Aug-2026 20:20:46] NOTICE:  pm = dynamic
[07-Aug-2026 20:20:46] NOTICE:  pm.max_children = 50
[07-Aug-2026 20:20:46] NOTICE:  pm.start_servers = 10
[07-Aug-2026 20:20:46] NOTICE:  pm.min_spare_servers = 10
[07-Aug-2026 20:20:46] NOTICE:  pm.max_spare_servers = 25
[07-Aug-2026 20:20:46] NOTICE:  pm.max_spawn_rate = 32
[07-Aug-2026 20:20:46] NOTICE:  pm.process_idle_timeout = 10
[07-Aug-2026 20:20:46] NOTICE:  pm.max_requests = 5000
[07-Aug-2026 20:20:46] NOTICE:  pm.status_path = /php-status
[07-Aug-2026 20:20:46] NOTICE:  pm.status_listen = undefined
[07-Aug-2026 20:20:46] NOTICE:  ping.path = undefined
[07-Aug-2026 20:20:46] NOTICE:  ping.response = undefined
[07-Aug-2026 20:20:46] NOTICE:  access.log = undefined
[07-Aug-2026 20:20:46] NOTICE:  access.format = undefined
[07-Aug-2026 20:20:46] NOTICE:  slowlog = undefined
[07-Aug-2026 20:20:46] NOTICE:  request_slowlog_timeout = 0s
[07-Aug-2026 20:20:46] NOTICE:  request_slowlog_trace_depth = 20
[07-Aug-2026 20:20:46] NOTICE:  request_terminate_timeout = 0s
[07-Aug-2026 20:20:46] NOTICE:  request_terminate_timeout_track_finished = no
[07-Aug-2026 20:20:46] NOTICE:  rlimit_files = 0
[07-Aug-2026 20:20:46] NOTICE:  rlimit_core = 0
[07-Aug-2026 20:20:46] NOTICE:  chroot = undefined
[07-Aug-2026 20:20:46] NOTICE:  chdir = undefined
[07-Aug-2026 20:20:46] NOTICE:  catch_workers_output = no
[07-Aug-2026 20:20:46] NOTICE:  decorate_workers_output = yes
[07-Aug-2026 20:20:46] NOTICE:  clear_env = yes
[07-Aug-2026 20:20:46] NOTICE:  security.limit_extensions = .php .phar
[07-Aug-2026 20:20:46] NOTICE:
[07-Aug-2026 20:20:46] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Idle Processes status

Image
PHP Version
PHP 8.4.24 (cli) (built: Aug  1 2026 14:53:20) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.24, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.24, Copyright (c), by Zend Technologies
Operating System

FreeBSD 14.4-RELEASE-p8

主要语言
C
星标
40.4k
派生
8.2k
平均合并
2 天 17 小时
30 天内合并 PR
115

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

php/php-src 的其他 Issue

查看 php/php-src 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。