{"id":33291,"date":"2026-09-18T12:00:00","date_gmt":"2026-09-18T04:00:00","guid":{"rendered":"https:\/\/cn.hostease.com\/blog\/?p=33291"},"modified":"2026-09-18T12:57:58","modified_gmt":"2026-09-18T04:57:58","slug":"wordpress-php-fpm-tuning","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/blog\/guides\/wordpress-php-fpm-tuning\/","title":{"rendered":"WordPress \u7f51\u7ad9\u63d0\u901f\uff1aPHP-FPM \u8fdb\u7a0b\u8c03\u4f18\u4e0e\u5185\u5b58\u9650\u5236\u914d\u7f6e\u5b9e\u64cd"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/wordpress-php-fpm-tuning-cover.webp\" alt=\"WordPress PHP-FPM \u8fdb\u7a0b\u8c03\u4f18\u5c01\u9762\u56fe\" loading=\"lazy\" \/><\/p>\n<p>\u5f53 WordPress \u7f51\u7ad9\u5728\u6d41\u91cf\u9ad8\u5cf0\u7a81\u7136\u53d8\u5361\u3001\u540e\u53f0\u4fdd\u5b58\u8f6c\u5708\u51e0\u5341\u79d2\uff0c\u751a\u81f3\u95f4\u6b47\u6027\u5f39\u51fa 502 \u6216 504 \u9519\u8bef\u65f6\uff0c\u5f88\u591a\u7ad9\u957f\u7684\u7b2c\u4e00\u53cd\u5e94\u662f\u6362\u66f4\u5927\u7684\u670d\u52a1\u5668\u3002\u5b9e\u9645\u4e0a\uff0c\u8fd9\u7c7b\u95ee\u9898\u591a\u6570\u51fa\u5728\u66f4\u57fa\u7840\u7684\u73af\u8282\uff1aPHP-FPM\uff08PHP \u8fdb\u7a0b\u7ba1\u7406\u5668\uff09\u6ca1\u6709\u8c03\u4f18\u3002\u8fd9\u7bc7\u6307\u5357\u4f1a\u6559\u4f60\u5982\u4f55\u7528\u771f\u5b9e\u5185\u5b58\u6570\u636e\u7b97\u51fa\u8fdb\u7a0b\u4e0a\u9650\uff0c\u9010\u9879\u914d\u597d memory_limit\u3001max_execution_time \u7b49\u53c2\u6570\uff0c\u5e76\u7528\u538b\u529b\u6d4b\u8bd5\u9a8c\u8bc1\u6548\u679c\uff0c\u4ece\u6839\u6e90\u4e0a\u89e3\u51b3 WordPress \u5361\u987f\u3002\u5982\u679c\u4f60\u6b63\u88ab\u7ad9\u70b9\u901f\u5ea6\u56f0\u6270\uff0c\u6216\u5728\u6311\u9009 <a href=\"https:\/\/cn.hostease.com\/wordpress-hosting\/\">WordPress \u4e3b\u673a<\/a>\u65b9\u6848\u65f6\u60f3\u641e\u61c2\u8d44\u6e90\u53c2\u6570\uff0c\u53ef\u4ee5\u76f4\u63a5\u7167\u505a\u3002<\/p>\n<h2>\u4e00\u3001PHP-FPM \u4e3a\u4ec0\u4e48\u51b3\u5b9a\u901f\u5ea6\u4e0a\u9650<\/h2>\n<p>WordPress \u662f\u5178\u578b\u7684 PHP \u52a8\u6001\u5e94\u7528\uff1a\u6bcf\u6b21\u9875\u9762\u8bf7\u6c42\uff0c\u670d\u52a1\u5668\u90fd\u8981\u6267\u884c\u6570\u767e\u4e2a PHP \u6587\u4ef6\u3001\u67e5\u8be2\u6570\u636e\u5e93\u3001\u62fc\u63a5 HTML\u3002\u8fd9\u4e9b\u4ee3\u7801\u7531 PHP-FPM \u7684 worker \u8fdb\u7a0b\u5904\u7406\u3002\u53ef\u4ee5\u628a\u5b83\u60f3\u8c61\u6210\u9910\u5385\u53a8\u623f\uff1a\u8ba2\u5355\u4e0d\u65ad\u8fdb\u6765\uff0c\u53a8\u5e08\uff08worker \u8fdb\u7a0b\uff09\u6570\u91cf\u56fa\u5b9a\uff1b\u53a8\u5e08\u4e0d\u591f\uff0c\u8ba2\u5355\u6392\u961f\uff0c\u9875\u9762\u5c31\u6162\uff1b\u53a8\u5e08\u592a\u591a\u800c\u53a8\u623f\u7a7a\u95f4\uff08\u5185\u5b58\uff09\u6709\u9650\uff0c\u6574\u4e2a\u53a8\u623f\u4f1a\u5d29\u6e83\u2014\u2014\u670d\u52a1\u5668\u5f00\u59cb\u4f7f\u7528\u4ea4\u6362\u5206\u533a\uff08swap\uff09\uff0c\u54cd\u5e94\u8d85\u65f6\u751a\u81f3\u8fdb\u7a0b\u88ab\u7cfb\u7edf\u6740\u6389\u3002<\/p>\n<p>\u63d2\u4ef6\u751f\u6001\u8ba9\u5185\u5b58\u95ee\u9898\u66f4\u7a81\u51fa\uff1a\u88c5\u4e86\u9875\u9762\u6784\u5efa\u5668\u3001WooCommerce \u6216\u7f13\u5b58\u63d2\u4ef6\u540e\uff0c\u5355\u4e2a PHP \u8fdb\u7a0b\u5360\u7528 80MB \u5230 150MB \u5f88\u5e38\u89c1\u3002\u5047\u8bbe\u4e00\u53f0 4GB \u5185\u5b58\u7684 <a href=\"https:\/\/cn.hostease.com\/vps\/\">VPS<\/a>\uff08<a href=\"https:\/\/cn.hostease.com\/vps\/\">\u865a\u62df\u4e13\u7528\u670d\u52a1\u5668<\/a>\uff09\uff0c\u7cfb\u7edf\u4e0e\u6570\u636e\u5e93\u5360\u7ea6 1.2GB\uff0c\u5269\u7ea6 2.8GB \u7ed9 PHP\uff1b\u5355\u8fdb\u7a0b\u5e73\u5747 90MB\uff0c\u7406\u8bba\u8fdb\u7a0b\u4e0a\u9650\u5c31\u662f 2800 \u00f7 90 \u2248 31 \u4e2a\u3002\u5982\u679c\u7167\u642c\u7f51\u4e0a\u7684&#8221;pm.max_children = 200&#8243;\uff0c\u7ed3\u679c\u53ea\u80fd\u662f\u5185\u5b58\u8017\u5c3d\u3002\u6240\u4ee5\u8c03\u4f18\u7b2c\u4e00\u6b65\u6c38\u8fdc\u662f\u6d4b\u91cf\uff0c\u4e0d\u662f\u6284\u914d\u7f6e\u3002<\/p>\n<h2>\u4e8c\u3001\u4e09\u79cd\u8fdb\u7a0b\u6a21\u5f0f\u600e\u4e48\u9009<\/h2>\n<p>PHP-FPM \u7684 pm \u53c2\u6570\u6709\u4e09\u79cd\u8fdb\u7a0b\u7ba1\u7406\u6a21\u5f0f\uff0c\u9009\u5bf9\u6a21\u5f0f\u662f\u540e\u7eed\u914d\u7f6e\u7684\u524d\u63d0\u3002<\/p>\n<p><code>static<\/code> \u6a21\u5f0f\u542f\u52a8\u65f6\u56fa\u5b9a\u521b\u5efa <code>pm.max_children<\/code> \u4e2a\u8fdb\u7a0b\uff0c\u6570\u91cf\u4e0d\u518d\u53d8\u5316\u3002\u6ca1\u6709\u8fdb\u7a0b\u51b7\u542f\u52a8\u5f00\u9500\uff0c\u9ad8\u5cf0\u671f\u6700\u7a33\u5b9a\uff1b\u4ee3\u4ef7\u662f\u65e0\u6d41\u91cf\u65f6\u5185\u5b58\u4e5f\u6301\u7eed\u5360\u7528\u3002\u9002\u5408\u5185\u5b58\u5145\u88d5\u3001\u6d41\u91cf\u5e73\u7a33\u7684\u5e38\u9a7b\u7ad9\u70b9\u3002<\/p>\n<p><code>dynamic<\/code> \u6a21\u5f0f\u6309\u533a\u95f4\u4f38\u7f29\uff1a\u542f\u52a8\u65f6\u521b\u5efa <code>pm.start_servers<\/code> \u4e2a\u8fdb\u7a0b\uff0c\u8d1f\u8f7d\u4e0a\u5347\u6269\u5230 <code>pm.max_children<\/code>\uff0c\u7a7a\u95f2\u540e\u56de\u6536\u81f3 <code>pm.min_spare_servers<\/code> \u4e0e <code>pm.max_spare_servers<\/code> \u4e4b\u95f4\u3002\u8fd9\u662f<a href=\"https:\/\/cn.hostease.com\/web-hosting\/\">\u5171\u4eab\u4e3b\u673a<\/a>\u548c\u591a\u6570\u4e2d\u5c0f WordPress \u7ad9\u70b9\u7684\u9ed8\u8ba4\u9009\u62e9\uff0c\u6ce8\u610f\u6700\u5c0f\u8fdb\u7a0b\u6570\u522b\u8bbe\u592a\u4f4e\uff0c\u5426\u5219\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u8981\u4ed8\u51fa\u8fdb\u7a0b\u542f\u52a8\u5ef6\u8fdf\u3002<\/p>\n<p><code>ondemand<\/code> \u6a21\u5f0f\u5e73\u65f6\u4e0d\u4fdd\u7559 worker\uff0c\u8bf7\u6c42\u8fdb\u6765\u624d\u521b\u5efa\uff0c\u7a7a\u95f2\u8d85\u65f6\u5373\u9500\u6bc1\u3002\u5bf9\u65e5\u5747\u51e0\u767e\u5230\u51e0\u5343 PV \u7684\u4f4e\u6d41\u91cf\u7ad9\u70b9\u6700\u7701\u5185\u5b58\uff0c\u4f46\u6bcf\u4e2a&#8221;\u51b7&#8221;\u8bf7\u6c42\u591a\u4ed8\u51fa\u7ea6 50-200 \u6beb\u79d2\uff0c\u4f1a\u62d6\u6162\u9996\u5b57\u8282\u65f6\u95f4\uff08TTFB\uff0c\u9996\u5b57\u8282\u65f6\u95f4\uff09\u3002<\/p>\n<p>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u5185\u5b58\u591f\u3001\u6d41\u91cf\u7a33\u9009 static\uff1b\u6709\u6ce2\u5cf0\u6ce2\u8c37\u9009 dynamic\uff1b\u6d41\u91cf\u7a00\u758f\u3001\u6781\u81f4\u7701\u5185\u5b58\u9009 ondemand\u3002\u60f3\u8fdb\u4e00\u6b65\u538b\u4f4e TTFB\uff0c\u53ef\u4ee5\u914d\u5408 <a href=\"https:\/\/cn.hostease.com\/blog\/guides\/ttfb-hosting-optimization\/\">TTFB \u4e3b\u673a\u4f18\u5316\u6307\u5357<\/a>\u518d\u4f18\u5316\u4e00\u5c42\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/php-fpm-pm-modes.webp\" alt=\"PHP-FPM \u8fdb\u7a0b\u7ba1\u7406\u4e09\u79cd\u6a21\u5f0f\u5bf9\u6bd4\" loading=\"lazy\" \/><\/p>\n<h2>\u4e09\u3001\u8ba1\u7b97\u5c5e\u4e8e\u4f60\u7684\u8fdb\u7a0b\u4e0a\u9650<\/h2>\n<p>\u8fdb\u7a0b\u4e0a\u9650\u8981\u7528\u4e24\u4e2a\u5b9e\u6d4b\u6570\u636e\u7b97\uff1a\u5355\u8fdb\u7a0b\u5e73\u5747\u5185\u5b58\u548c PHP \u53ef\u7528\u603b\u5185\u5b58\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff0c\u5b9e\u6d4b\u5355\u8fdb\u7a0b\u5e73\u5747\u5185\u5b58\uff08\u8ba9\u7ad9\u70b9\u5148\u8dd1\u8fc7\u4e00\u6b21\u8bbf\u95ee\u9ad8\u5cf0\uff09\uff1a<\/p>\n<pre><code class=\"language-bash\">ps --no-headers -o rss -C php-fpm | awk '{sum+=$1; n++} END {printf &quot;%d MB avg across %d procs\\n&quot;, sum\/n\/1024, n}'\n<\/code><\/pre>\n<p>\u8fd9\u6761\u547d\u4ee4\u5bf9\u6240\u6709 php-fpm \u8fdb\u7a0b\u7684\u5e38\u9a7b\u5185\u5b58\u53d6\u5e73\u5747\uff0c\u7ed3\u679c\u5efa\u8bae\u518d\u52a0 10% \u5b89\u5168\u4f59\u91cf\uff0c\u56e0\u4e3a\u9ad8\u5cf0\u671f\u63d2\u4ef6\u52a0\u8f7d\u66f4\u6ee1\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff0c\u786e\u8ba4\u53ef\u7528\u603b\u5185\u5b58\uff1a<\/p>\n<pre><code class=\"language-bash\">free -m\n<\/code><\/pre>\n<p>\u770b <code>available<\/code> \u4e00\u5217\uff0c\u518d\u7ed9\u7cfb\u7edf\u9884\u7559 20% \u5de6\u53f3\uff0c\u5269\u4f59\u624d\u5212\u7ed9 PHP-FPM\u3002\u7b2c\u4e09\u6b65\u5957\u516c\u5f0f\uff1a<\/p>\n<pre><code class=\"language-text\">pm.max_children = (\u53ef\u7528\u5185\u5b58 \u00d7 0.8) \u00f7 \u5355\u8fdb\u7a0b\u5e73\u5747\u5185\u5b58\n<\/code><\/pre>\n<p>\u4f8b\u5982 2GB \u5185\u5b58\u673a\u5668 available \u7ea6 1200MB\u3001\u5355\u8fdb\u7a0b\u6309 95MB \u7b97\uff0cmax_children = 1200 \u00d7 0.8 \u00f7 95 \u2248 10\u3002\u82e5\u7b97\u51fa\u6765\u4e0d\u8db3 5\uff0c\u8bf4\u660e\u8be5\u5347\u7ea7\u914d\u7f6e\u6216\u7cbe\u7b80\u63d2\u4ef6\u3002<code>dynamic<\/code> \u6a21\u5f0f\u914d\u5957\u53c2\u6570\uff1a<code>pm.start_servers<\/code> \u53d6\u4e0a\u9650\u7684 25%-40%\uff0c<code>pm.max_spare_servers<\/code> \u4e0d\u8d85\u8fc7\u4e0a\u9650\u7684 60%\u3002\u66f4\u591a\u5206\u6790\u5b9e\u4f8b\u89c1 <a href=\"https:\/\/cn.hostease.com\/blog\/server\/\">\u670d\u52a1\u5668\u4f18\u5316\u4e13\u680f<\/a>\u3002<\/p>\n<h2>\u56db\u3001\u5185\u5b58\u4e0e\u6267\u884c\u53c2\u6570\u9010\u9879\u914d\u7f6e<\/h2>\n<p>\u8fdb\u7a0b\u6570\u89e3\u51b3&#8221;\u591a\u5c11\u4e2a\u8fdb\u7a0b&#8221;\uff0c\u8fd9\u7ec4\u53c2\u6570\u51b3\u5b9a&#8221;\u6bcf\u4e2a\u8fdb\u7a0b\u600e\u4e48\u7528\u8d44\u6e90&#8221;\uff0c\u5206\u5e03\u5728\u6c60\u914d\u7f6e\uff08<code>\/etc\/php-fpm.d\/www.conf<\/code>\uff09\u548c <code>php.ini<\/code> \u4e24\u5904\u3002<\/p>\n<p><strong>memory_limit<\/strong> \u9650\u5236\u5355\u8fdb\u7a0b\u5185\u5b58\u4e0a\u9650\u3002WordPress \u5b98\u65b9\u5efa\u8bae\u81f3\u5c11 256MB\uff1b\u53ea\u6709\u57fa\u7840\u63d2\u4ef6\u7684\u7ad9\u70b9 128MB \u5e38\u591f\u7528\uff1b\u8dd1 WooCommerce \u6216 Elementor \u5efa\u8bae 256MB \u8d77\u6b65\u3002\u6ce8\u610f\u5b83\u662f&#8221;\u5929\u82b1\u677f&#8221;\u800c\u975e\u9884\u5206\u914d\uff0c\u8bbe\u8fc7\u5927\u4e0d\u4f1a\u591a\u8017\u5185\u5b58\uff0c\u4f46\u4f1a\u63a9\u76d6\u63d2\u4ef6\u5185\u5b58\u6cc4\u6f0f\u3002\u62a5 &#8220;Allowed memory size exhausted&#8221; \u65f6\uff0c\u5148\u5b9a\u4f4d\u5403\u5185\u5b58\u7684\u63d2\u4ef6\uff0c\u800c\u4e0d\u662f\u65e0\u8111\u8c03\u5927\u3002<\/p>\n<p><strong>max_execution_time<\/strong> \u5efa\u8bae\u8bbe 120-300 \u79d2\uff1a\u592a\u77ed\u4f1a\u8ba9\u5907\u4efd\u3001\u6279\u91cf\u5bfc\u51fa\u592d\u6298\uff0c\u592a\u957f\u5219\u5361\u6b7b\u8bf7\u6c42\u957f\u671f\u5360\u4f4f worker\u3002<strong>max_input_vars<\/strong> \u9ed8\u8ba4 1000 \u4f1a\u8ba9\u5927\u578b\u83dc\u5355\u4fdd\u5b58\u65f6\u9759\u9ed8\u4e22\u9879\uff0c\u5efa\u8bae\u63d0\u5230 3000\u3002<\/p>\n<p>dynamic \u6a21\u5f0f\u7684\u6c60\u914d\u7f6e\u793a\u8303\uff08\u6309\u4e0a\u8282\u7b97\u51fa\u7684\u4e0a\u9650\uff09\uff1a<\/p>\n<pre><code class=\"language-ini\">pm = dynamic\npm.max_children = 10\npm.start_servers = 3\npm.min_spare_servers = 2\npm.max_spare_servers = 6\npm.process_idle_timeout = 20s\n<\/code><\/pre>\n<p>\u6539\u5b8c\u5148 <code>php-fpm -tt<\/code> \u505a\u8bed\u6cd5\u68c0\u67e5\u5e76\u6253\u5370\u751f\u6548\u503c\uff0c\u518d <code>systemctl reload php-fpm<\/code> \u5e73\u6ed1\u751f\u6548\u3002\u6bcf\u6b21\u53ea\u8c03\u4e00\u4e2a\u53c2\u6570\u5e76\u8bb0\u5f55\u53d8\u66f4\uff0c\u6392\u67e5\u56de\u5f52\u6700\u6709\u6548\u3002\u66f4\u591a\u5b9e\u64cd\u6574\u7406\u5728 <a href=\"https:\/\/cn.hostease.com\/blog\/wordpress\/\">WordPress \u6559\u7a0b\u4e13\u680f<\/a>\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/php-memory-tuning.webp\" alt=\"PHP \u5185\u5b58\u4e0e\u6267\u884c\u53c2\u6570\u914d\u7f6e\u573a\u666f\" loading=\"lazy\" \/><\/p>\n<h2>\u4e94\u3001\u538b\u529b\u6d4b\u8bd5\u4e0e\u76d1\u63a7\u9a8c\u8bc1<\/h2>\n<p>\u8c03\u4f18\u8981\u7528\u6570\u636e\u6536\u5c3e\u3002\u5148\u770b\u5b9e\u65f6\u8fdb\u7a0b\u6570\uff1a<\/p>\n<pre><code class=\"language-bash\">watch -n 1 &quot;ps aux | grep php-fpm | grep -v grep | wc -l&quot;\n<\/code><\/pre>\n<p>\u82e5\u8fdb\u7a0b\u6570\u957f\u671f\u8d34\u7740 max_children\uff0c\u8bf4\u660e\u5e76\u53d1\u4e0a\u9650\u8bbe\u4f4e\u4e86\uff0c\u8bf7\u6c42\u5728\u6392\u961f\uff1b\u82e5\u8fdb\u7a0b\u6570\u8fdc\u4f4e\u4e8e\u4e0a\u9650\u4f46\u7ad9\u70b9\u4ecd\u6162\uff0c\u74f6\u9888\u591a\u534a\u5728\u6570\u636e\u5e93\u6216\u7f13\u5b58\u5c42\u3002\u518d\u7528 ab \u538b\u6d4b\u5bf9\u6bd4\uff08500 \u4e2a\u8bf7\u6c42\u300110 \u5e76\u53d1\uff09\uff1a<\/p>\n<pre><code class=\"language-bash\">ab -n 500 -c 10 https:\/\/\u4f60\u7684\u57df\u540d\/\n<\/code><\/pre>\n<p>\u5173\u6ce8 <code>Requests per second<\/code>\uff08\u541e\u5410\u91cf\uff09\u548c <code>Time per request<\/code>\uff08\u5ef6\u8fdf\uff09\uff0c\u8c03\u4f18\u524d\u8dd1\u4e00\u6b21\u8bb0\u5f55\u57fa\u7ebf\uff0c\u6539\u914d\u7f6e\u540e\u518d\u8dd1\u4e00\u6b21\uff1a\u541e\u5410\u4e0a\u5347\u3001\u5ef6\u8fdf\u4e0b\u964d\u3001\u65e0 502\/504 \u5373\u65b9\u5411\u6b63\u786e\u3002\u8fdb\u9636\u505a\u6cd5\u662f\u5e76\u53d1\u4ece 5\u300110\u300120 \u9636\u68af\u4e0a\u8c03\uff0c\u627e&#8221;\u5ef6\u8fdf\u9661\u589e&#8221;\u7684\u62d0\u70b9\uff0c\u90a3\u5c31\u662f\u8fd9\u5957\u914d\u7f6e\u7684\u771f\u5b9e\u627f\u8f7d\u80fd\u529b\u3002<\/p>\n<p>\u65e5\u5e38\u76d1\u63a7\u6293\u4f4f\u4e09\u4e2a\u4fe1\u53f7\uff1a\u5185\u5b58\u4f7f\u7528\u7387\u6301\u7eed\u9ad8\u4e8e 85%\u3001swap \u5f00\u59cb\u6d3b\u8dc3\u3001PHP-FPM \u65e5\u5fd7\u51fa\u73b0 &#8220;server reached pm.max_children&#8221; \u8b66\u544a\u3002\u7b2c\u4e09\u6761\u5c24\u5176\u503c\u5f97\u505a\u6210\u5b9a\u65f6\u544a\u8b66\uff0c\u5b83\u662f\u7ad9\u70b9\u8fc7\u8f7d\u6700\u65e9\u7684\u4fe1\u53f7\u3002\u66f4\u591a\u6027\u80fd\u4e0e <a href=\"https:\/\/cn.hostease.com\/web-hosting\/\">\u865a\u62df\u4e3b\u673a<\/a>\u8d44\u6e90\u642d\u914d\u7684\u7ecf\u9a8c\uff0c\u540e\u7eed\u4f1a\u7ee7\u7eed\u5c55\u5f00\u3002<\/p>\n<h2>\u603b\u7ed3\u4e0e\u884c\u52a8\u5efa\u8bae<\/h2>\n<p>PHP-FPM \u8c03\u4f18\u7684\u6838\u5fc3\u662f\u4e09\u6b65\uff1a\u5148\u6d4b\u5185\u5b58\uff0c\u518d\u7b97 max_children\uff0c\u6700\u540e\u538b\u6d4b\u9a8c\u8bc1\u3002\u5bb9\u6613\u51fa\u9519\u7684\u6c38\u8fdc\u662f\u8df3\u8fc7\u6d4b\u91cf\u76f4\u63a5\u6284\u914d\u7f6e\u2014\u2014\u540c\u4e00\u4efd <code>www.conf<\/code> \u5728\u522b\u4eba 8GB \u673a\u5668\u4e0a\u662f\u89e3\u836f\uff0c\u5728\u4f60\u7684 2GB VPS \u4e0a\u53ef\u80fd\u5c31\u662f\u5b95\u673a\u5f00\u5173\u3002\u5efa\u8bae\u6309\u8fd9\u4e2a\u987a\u5e8f\u6267\u884c\uff1a<\/p>\n<ol>\n<li>\u7528 <code>ps<\/code> \u5b9e\u6d4b\u5355\u8fdb\u7a0b\u5185\u5b58\uff0c\u7528 <code>free -m<\/code> \u786e\u8ba4\u53ef\u7528\u603b\u5185\u5b58\uff1b<\/li>\n<li>\u6309\u516c\u5f0f\u8ba1\u7b97 max_children\uff0c\u914d\u597d dynamic \u6a21\u5f0f\u53c2\u6570\uff1b<\/li>\n<li>\u6838\u5bf9 memory_limit\u3001max_execution_time\u3001max_input_vars\uff1b<\/li>\n<li><code>php-fpm -tt<\/code> \u6821\u9a8c\u540e reload\uff0c\u538b\u6d4b\u5bf9\u6bd4\u524d\u540e\u6307\u6807\uff1b<\/li>\n<li>\u76d1\u63a7\u52a0\u4e0a &#8220;max_children&#8221; \u65e5\u5fd7\u544a\u8b66\uff0c\u8fc7\u8f7d\u63d0\u524d\u9884\u8b66\u3002<\/li>\n<\/ol>\n<p>\u5982\u679c\u4f60\u521a\u63a5\u89e6\u670d\u52a1\u5668\u8fd0\u7ef4\uff0c\u53ef\u4ee5\u8003\u8651\u5148\u7528 <a href=\"https:\/\/cn.hostease.com\/wordpress-hosting\/\">WordPress \u4e3b\u673a<\/a>\u6258\u7ba1\u65b9\u6848\u8fc7\u6e21\uff1aHostease \u7684\u4e3b\u673a\u73af\u5883\u5df2\u9884\u8bbe\u5408\u7406\u7684 PHP \u7248\u672c\u4e0e\u5185\u5b58\u53c2\u6570\uff0c\u9047\u5230\u74f6\u9888\u518d\u6309\u672c\u6587\u65b9\u6cd5\u6df1\u5ea6\u5b9a\u5236\uff0c\u5b66\u4e60\u66f2\u7ebf\u4f1a\u5e73\u7f13\u5f88\u591a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bb2\u89e3 PHP-FPM \u8fdb\u7a0b\u6a21\u5f0f\u3001pm.max_children \u8ba1\u7b97\u65b9\u6cd5\u4e0e memory_limit \u914d\u7f6e\u5b9e\u64cd\uff0c\u5e2e\u52a9\u4f60\u89e3\u51b3 WordPress \u5361\u987f\u4e0e 502\/504 \u62a5\u9519\uff0c\u63d0\u5347\u7ad9\u70b9\u901f\u5ea6\u3002<\/p>\n","protected":false},"author":2,"featured_media":33288,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3822],"tags":[4496,84,5119,5120],"class_list":["post-33291","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","tag-php-fpm-2","tag-wordpress","tag-5119","tag-5120"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/wordpress-php-fpm-tuning-cover.webp","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/33291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/comments?post=33291"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/33291\/revisions"}],"predecessor-version":[{"id":33298,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/33291\/revisions\/33298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/media\/33288"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/media?parent=33291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/categories?post=33291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/tags?post=33291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}