![]() The major difference between PHP-FPM and a Rails or Java application is that PHP-FPM offers “PHP as as service” whereas a Rails application runs the “Application as a service”. After it finishes, it is available for the next request. Since PHP is single-threaded for web requests, each process can only run a single request at a time. There is the manager process which controls the PHP processes, and multiple PHP processes to run the request. What is PHP-FPM?įPM manages a pool of PHP processes which incoming web requests without the startup penalty. It uses a control process and worker or child processes to perform the reqeuests concurrently. With mod_php, the overhead of the per-process request was solved, but it could only scale vertically (larger servers), and likely had other runtime and security implications.įastCGI pushed the application into a separate process outside the web server, even to one or more servers, allowing the application to scale horizontally (more servers). The Apache web server introduced the mod_php module which ran PHP inside apache. This was great for simple scripts, but was too much overhead for more complicated applications. Originally, web servers provided the Common Gateway Interface ( CGI) as a method to run programs to create dymanic content for a web request.Įach CGI request caused the web server to fork a new process, initialize the runtime (ususally Perl), load the source code and run the program to produce content. ![]() This post aims to clarify the concepts and settings of PHP-FPM in general.Īctual installation commands are only a google search away. It is now the preferred way to run a PHP application. ![]() To scale your PHP application, run it with PHP-FPM (FastCGI Process Manager).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |