ããíÒÇÊ / ÝÇÆÏÉ php fpm pool áãæÇÞÚ æíÈ / ææÑÏÈÑíÓ ÇÓÑÚ 300%
PHP-FPM (FastCGI Process Manager) dramatically speeds up the performance
ãä ÇáÚãáíÇÊ ÇáÃÈØÃ (mod_PHP) Åáì ÇáÚãáíÇÊ ÇáÃÓÑÚ ÈßËíÑ ÈÇÓÊÎÏÇã PHP-FPM
ãÇ åæ PHP-FPM¿
ãä æÌåÉ äÙÑ ÒÇÆÑ ÇáãæÞÚ ¡ ÞÏ áÇ íßæä ÇáÊÍæíá ãä mod_PHP Åáì PHP-FPM ÕÝÞÉ ßÈíÑÉ. æãÚ Ðáß ¡ ãä æÌåÉ äÙÑ ãåäÏÓ ÇáäÙÇã ¡ ßáÇåãÇ ÃãÑÇä ãÎÊáÝÇä ÊãÇãðÇ. íÏÑß ÌãíÚ ãåäÏÓæ ÇáäÙÇã Ãä PHP íÚãá ãÚ ÌãíÚ ÎæÇÏã ÇáæíÈ ÇáÑÆíÓíÉ æíãßä ÊÔÛíáå ÈØÑÞ ãÎÊáÝÉ Úáì ÇáÎÇÏã ÇáÎÇÕ Èß. æÇÍÏÉ ãä ÃßËÑ ÇáØÑÞ ÇáãÚÑæÝÉ áÊÔÛíá PHP åí æÍÏÉ mod_php. åÐÇ áÃäå íÃÊí ÇÝÊÑÇÖíðÇ Úáì ÎæÇÏã Apache HTTP. æáßä åäÇß ãÔßáÉ ÈÓíØÉ. ÈÎáÇÝ PHP-FPM¡ íÞæã mod_PHP ÈÅÛáÇÞ ÇáÚãáíÇÊ æÊÚØíá ÃÏÇÁ ãæÞÚ ÇáæíÈ. ÅÐÇ ßÇä åÏÝß ÇáÃÓÇÓí áÇÓÊÖÇÝÉ ÊØÈíÞ ÇáæíÈ ÇáÎÇÕ Èß åæ ÊÍÞíÞ ÇáÃÏÇÁ ÇáÃãËá æÇáÃãÇä ¡ ÝÅä PHP-FPM åí ÇáØÑíÞ Åáì ÇáÃãÇã.
PHP-FPM (ãÏíÑ ÚãáíÇÊ FastCGI) íÓÑÚ ÈÔßá ßÈíÑ ãä ÃÏÇÁ ÈíÆÉ PHP ÇáÎÇÕÉ Èß.
ãÞÇÑäÉ Èíä PHP-FPM vs. mod_PHP Performance Benchmarks
ÈÇÓÊÎÏÇã ÈíÆÉ ãÍßæãÉ ¡ ÞãäÇ ÈÇÎÊÈÇÑ ãæÞÚ æíÈ ææÑÏÈÑíÓ WordPress ÈÇÓÊÎÏÇã PHP-FPM æ mod_PHP Ýí ßá ãÑÉ ¡ áÇÍÙäÇ ÒíÇÏÉ ÇáÃÏÇÁ æÇáÇÓÊÞÑÇÑ ãÚ ÇáãßÏÓ ÇáÐí íÍÊæí Úáì PHP-FPM.
ÇáÃÏÇÁ ãÚ Performance with mod_PHP
ÇÓÊÎÏãäÇ ÎÇÏã 4 ÌíÌÇÈÇíÊ. ÇáÊØÈíÞ áåÐÇ ÇáÇÎÊÈÇÑ ßÇä ãæÞÚ ææÑÏÈÑíÓ.
ÍÞÞ ÇáÇÎÊÈÇÑ 38.046 ÒíÇÑÉ äÇÌÍÉ Ýí 295.0 ËÇäíÉ ãÚ äÞá ÇáÈíÇäÇÊ ãä 7¡399.11 ßíáæÈÇíÊ Ýí æ 206¡219.42 ßíáæÈÇíÊ ãä ÇáÊØÈíÞ. ãÊæÓØ ​​ãÚÏá ÇáÏÎæá ÇáÈÇáÛ 128.0 / ËÇäíÉ íÊÑÌã Åáì ÍæÇáí 11059200 ÒíÇÑÉ / íæã.
ßÇä ãÊæÓØ Òãä ÇáÇÓÊÌÇÈÉ 2150 ãááí ËÇäíÉ.
ÇáÃÏÇÁ ãÚ Performance with PHP-FPM
ÇáÔíÁ ÇáæÍíÏ ÇáãÎÊáÝ Ýí åÐÇ ÇáÇÎÊÈÇÑ åæ ÅÖÇÝÉ PHP-FPM.
ÍÞÞ ÇáÇÎÊÈÇÑ 85¡829 ÒíÇÑÉ äÇÌÍÉ Ýí 295.0 ËÇäíÉ ÈäÞá 16¡465.18 ßíáæÈÇíÊ Ýí æ 465¡728.74 ßíáæÈÇíÊ ãä ÇáÈíÇäÇÊ ÇáÎÇÑÌÉ ãä ÇáÊØÈíÞ. ãÚÏá ÖÑÈ ãÊæÓØ ​​290.0 / ËÇäíÉ íÊÑÌã Åáì ÍæÇáí 2556000 ÒíÇÑÉ / íæã.
ßÇä ãÊæÓØ Òãä ÇáÇÓÊÌÇÈÉ 628 ãááí ËÇäíÉ.
ÇáäÊÇÆÌ
íãßäß ãáÇÍÙÉ Ãä PHP-FPM ÌÚá ãæÞÚ ÇáÇÎÊÈÇÑ ÇáÎÇÕ ÈäÇ ÃÓÑÚ ÈäÍæ 350% ÚäÏãÇ íÊÚáÞ ÇáÃãÑ ÈÃæÞÇÊ ÇáÊÍãíá loading times. ÈÇáÅÖÇÝÉ Åáì Ðáß ¡ ÌÚá ÇáãæÞÚ ÖÚÝ ÇáßÝÇÁÉ ááãæÇÑÏ ßãÇ ßÇä ãÚ mod_php åäÇ äÓÊØíÚ Þæá Çä PHP-FPM ¡ æÇÍÏÉ ãä ÃÍÏË ÇáØÑÞ áÇÓÊÎÏÇã PHP ãÚ ÎÇÏã ÇáæíÈ ¡ åæ PHP FastCGI ÈÏíá. íãßä ÇÓÊÎÏÇã æÍÏÉ PHP åÐå ãÚ Ãí ÎÇÏã æíÈ ãÊæÇÝÞ ãÚ ÈÑæÊæßæá FastCGI.
ÇáãíÒÉ ÇáÑÆíÓíÉ áÜ PHP-FPM åí ÃäåÇ ÊÚÊãÏ Úáì ãÝåæã ÅÏÇÑÉ pool íãßä ÚÑÖ ßá ãÌãæÚÉ ãä ãÌãæÚÇÊ PHP-FPM Úáì ÃäåÇ äÓÎÉ ßÇãáÉ ãä PHP ¡ áåÇ Êßæíä æÍÏæÏ æÞíæÏ ÎÇÕÉ ÈåÇ. åÐå ÇáÞíæÏ æÇáÞíæÏ æÇáÊßæíäÇÊ ÊÊÚáÞ ÈÇáÚãáíÇÊ ÇáÝÑÚíÉ æÇáæÍÏÇÊ æãÊÛíÑÇÊ ÇáÈíÆÉ æÇáãÌáÏÇÊ æÇáÓÌáÇÊ ÇáÊÇÈÚÉ.
ßíÝíÉ Êãßíä PHP-FPM¿
ááÎæÇÏã ÇáÊí Êã ÅØáÇÞåÇ ÈÚÏ åÐÇ ÇáÅÚáÇä ÈÊÇÑíÎ 23 ÃÛÓØÓ 2016 ¡ Êã Êãßíä PHP-FPM ÇÝÊÑÇÖíðÇ. ÈÇáäÓÈÉ áãËíáÇÊ ÇáÎÇÏã ÇáÌÏíÏÉ ¡ Êã ÓÍÈ mod_PHP ÈÔßá ÇÝÊÑÇÖí. ÈÇáäÓÈÉ ááÎæÇÏã ÇáÊí íÊã ÊÔÛíáåÇ ÞÈá 23 ÃÛÓØÓ ¡ íãßäß Êãßíä PHP-FPM ãä ÎáÇá ÇáÇäÊÞÇá Åáì åÐÇ ÇáÏáíá ÇáÊÏÑíÌí.
PHP-FPM ãÞÇÈá mod_PHP: ÃíåãÇ ÃÝÖá¿
äÍä äÚÊÞÏ Ãäå Ýí ÇáÍÞíÞÉ áíÓÊ ãÓÃáÉ PHP-FPM ãÞÇÈá mod_PHP. ãä ÎáÇá åÐå ÇáÎØæÉ ¡ äÓÊåÏÝ ÇáÌæÇäÈ ÇáÑÆíÓíÉ: ÇáãæËæÞíÉ æÇáÃãÇä æÞÇÈáíÉ ÇáÊæÓÚ æÇáÓÑÚÉ. íæÝÑ PHP-FPM ßá Ðáß ÌäÈðÇ Åáì ÌäÈ ãÚ ÇáßËíÑ ãä ÝÑÕ ÇáÊÎÕíÕ æÖÈØ ÇáÃÏÇÁ. áÐáß ¡ ãä Çáããßä ÝÞØ ÇáÇäÊÞÇá ãä ÇáÚãáíÇÊ ÇáÃÈØÃ (mod_PHP) Åáì ÇáÚãáíÇÊ ÇáÃÓÑÚ ÈßËíÑ ÈÇÓÊÎÏÇã PHP-FPM.
-------------------------------------------------
How to Use PHP-FPM with cPanel
PHP performance is an enduring issue for web hosts. PHP is the most widely used server programming language on the web by a big margin. The most popular content management systems and ecommerce applications are written in PHP, including WordPress®, Joomla, Drupal, Magento®, and dozens more.
The ultra-fast PHP-FPM accelerates PHP execution on busy web servers, making it a valuable tool in the fight against slow sites and resource-constrained servers.
This article takes a deep dive into how PHP-FPM works and explains how to deploy and configure it with cPanel & WHM.
What is PHP-FPM?
PHP-FPM is an alternative PHP implementation that makes busy web applications faster while helping system administrators to control resource consumption on their server.
A PHP implementation, also known as the runtime, interprets and executes code. Traditional runtimes such as Apache’s mod_PHP do their work within the web server. That approach has advantages, but each connection consumes a chunk of the server’s resources for as long as it lasts. If there are too many concurrent connections, the server may run out of resources like memory altogether, impacting the performance of every site it hosts.
PHP-FPM does things differently: it operates outside of the web server and uses a pool of worker processes to execute code. The workers are ready and waiting when a request comes in, and you can control how many workers are in the pool so they can’t multiply until they consume all the server’s RAM and processor time.
It works like this:
- Apache sends code to PHP-FPM over a high-speed binary interface called FastCGI.
- A supervisor process chooses a worker process from the pool and gives it the code.
- The worker executes the code, and the result is sent back to Apache, which sends it to the web browser.
- Once the worker is done, it returns to the pool to await another chunk of code to execute.
If there are too many concurrent connections, some might have to wait for a free worker, but they will never consume all of the server’s resources. On a busy web server, worker pools are faster and more efficient than other strategies.
Getting Started with PHP-FPM in CentOS and EasyApache
It is straightforward to activate and configure PHP-FPM in cPanel & WHM. You can choose which domains use it and set configuration variables that influence its behavior.
The first step is to turn it on in the
System PHP-FPM settings in WHM’s
MutliPHP Manager.

When you click
Turn On, WHM makes PHP-FPM available, but it doesn’t activate it for all domains automatically. You can force all accounts on the server to use PHP-FPM by clicking
Convert All Accounts to PHP-FPM.

Alternatively, you can activate PHP-FPM for individual domains in the table at the bottom of this page. To turn it on for several domains at once, select them in the table and choose
On in the drop-down menu.
Configuring PHP-FPM in cPanel
Once you have activated PHP-FPM, you can configure both the system defaults and the settings for individual domains in
MultiPHP Manager.
Click the
System PHP-FPM Configuration tab.

In this section, there are three pool settings you can change. These are the default values that are applied to domain pools.
- Max Requests: The number of requests each worker process should execute before it restarts itself. This setting is useful for working around memory leaks. The default of 20 is acceptable for most web hosting scenarios, but you may want to increase it to between 40 and 60 on servers with heavy traffic.
- Process Idle Timeout: How long an idle worker process will wait before shutting down. Idle processes consume resources, so we don’t want too many hanging around, but we don’t want to kill them too soon because it takes a while to start new ones. The default of 10 (seconds) may be too low for a busy server.
- Max Children: The maximum number of worker processes in each pool. The default is 5.
Many factors affect the optimal values for these settings, including the code your server runs and the amount of RAM it has. We wrote
PHP-FPM Performance Tuning Basicsto help you decide on the correct values for your server.

Underneath the pool options are PHP INI directives. We surface several of the most useful in the interface, and you can find more information about them in PHP’s
Runtime Configuration documentation. We’ll show you how to add other directives in the next section.
In addition to system-wide configuration, you can also configure individual domains in the WHM interface.

In the table at the bottom of
MutliPHP Manager, click
Edit PHP-FPM at the end of the domain’s row. The options that appear are identical to those in the system-wide configuration interface.
ÇáãÝÖáÇÊ