You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何查看当前pm.max_children配置值?配置修改后未生效问题排查

How to Check the Current pm.max_children Value for PHP-FPM

Let’s break down how to verify the active pm.max_children value for your PHP-FPM instance, plus a quick note on why your change might not have taken effect yet:

1. Use phpinfo() to See Runtime Configuration

Create a temporary PHP file (e.g., info.php) in your web server’s document root with this content:

<?php
phpinfo();
?>

Access this file via your browser (like http://your-domain/info.php), then use your browser’s search function to look for pm.max_children. You’ll find it under the PHP-FPM section—make sure to check the entry for your "www" pool specifically.

⚠️ Critical: Delete this file right after checking. Exposing phpinfo() publicly is a serious security risk.

2. Check via PHP-FPM’s Command Line Tools

For PHP 7.0 FPM, run these commands directly on your server terminal:

  • To test and print the parsed configuration (including pool settings):
    php-fpm7.0 -tt
    
    Scan the output for pm.max_children under the [pool www] block. This shows the value PHP-FPM will use with your current config files.
  • To fetch runtime info similar to phpinfo() via CLI:
    php-fpm7.0 -i | grep "pm.max_children"
    

3. Inspect Running PHP-FPM Processes

To confirm the configuration loaded by the active PHP-FPM daemon:

  1. Get the main PHP-FPM process ID:
    pidof php-fpm7.0
    
  2. View its command line arguments to verify which config file it’s using:
    cat /proc/$(pidof php-fpm7.0)/cmdline | tr '\0' ' '
    
    Look for a --fpm-config flag or the default path (/etc/php/7.0/fpm/php-fpm.conf, which includes pool configs like www.conf).

A Quick Fix for Your Original Issue

Wait—you mentioned restarting Apache after modifying www.conf, but PHP-FPM is a separate service from Apache. Changes to PHP-FPM configs require restarting the PHP-FPM service itself, not Apache. Try this command to apply your change:

sudo systemctl restart php7.0-fpm
# Or if using init.d:
sudo service php7.0-fpm restart

That’s likely why your pm.max_children update didn’t take effect initially!

内容的提问来源于stack exchange,提问作者Tilman

火山引擎 最新活动