Cobra Forum

Plesk Panel => Webserver => Topic started by: mahesh on Dec 03, 2024, 06:40 AM

Title: What is the difference between PHP handlers in Plesk?
Post by: mahesh on Dec 03, 2024, 06:40 AM
Question
What is the difference between FastCGI, FPM and dedicated FPM served by nginx or Apache PHP handlers in Plesk?

Answer
Briefly saying, their major difference is in site isolation level - the more isolated the handler is, the more secure it is to use. In ascending order:

Performance impact is another difference.
FastCGI
FastCGI is an improved version of the CGI handler used in the old PHP versions. FastCGI has better security than CGI: its process runs on behalf of the Plesk subscription's system user instead of the Apache user. Having fewer privileges limits the attacker's actions in case the subscription user is compromised.

Compared to FPM, FastCGI is slower and generally consumes more RAM.
FPM
PHP-FPM (FastCGI Process Manager) is a process manager for FastCGI SAPI (Server API). It is more secure, faster, and consumes less RAM compared to FastCGI. More details are available on this blog page: https://www.plesk.com/blog/various/why-do-you-need-php-fpm/
The downside is that all FPM processes have one point of failure - a common master process. All websites with the same PHP handler on PHP-FPM use a single FPM master, which means that:

Dedicated FPM
Dedicated FPM introduces more granular control for PHP-FPM master processes: per subscription or per-domain. This means improved stability and isolation for Plesk websites working with PHP-FPM handlers.

However, this leads to increased load on the server.
FPM served by Apache vs FPM served by nginx
Consider the following when chosing between FPM served by Apache or FPM served by nginx in Domains > example.com > PHP Settings:


Generally, it is recommended to enable FPM served by nginx for better site performance and lower CPU load. It is also recommended to keep proxy mode enabled in Domains > example.com > Apache & nginx Settings because it allows both Apache and nginx to handle the tasks they are the best suited for.