php / php/php-src

PHP‑FPM workers exceed pm.max_requests

Đang mở
#23,122 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Bug SAPI: fpm Status: Needs Triage
Ngôn ngữ chính
C
Star
40.4k
Fork
8.1k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi được báo cáo dưới tải liên tục với pm.max_requests=5000, sử dụng cấu hình PHP-FPM và bằng chứng worker-status trong issue. Theo dõi hành vi đếm request và tái sử dụng worker của PHP-FPM; được xem là hoàn tất khi sự khác biệt được giải thích và các worker được tái sử dụng một cách đáng tin cậy ở giới hạn đã cấu hình, với coverage cho trường hợp đã quan sát.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
php
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.