Prefork MPM:-
Prefork MPM launches multiple child processes. Each child process handle one connection at a time.
Prefork uses high memory in comparison to worker MPM. Prefork is the default MPM used by Apache2 server. Preform MPM always runs few minimum (MinSpareServers) defined processes as spare, so new requests do not need to wait for new process to start.
Worker MPM:-
Worker MPM generates multiple child processes similar to prefork. Each child process runs many threads. Each thread handles one connection at a time.
In sort Worker MPM implements a hybrid multi-process multi-threaded server. Worker MPM uses low memory in comparison to Prefork MPM.
Event MPM:-
Event MPM is introduced in Apache 2.4, It is pretty similar to worker MPM but it designed for managing high loads.
This MPM allows more requests to be served simultaneously by passing off some processing work to supporting threads. Using this MPM Apache tries to fix the ‘keep alive problem’ faced by other MPM. When a client completes the first request then the client can keep the connection open, and send further requests using the same socket, which reduces connection overload.
https://serverfault.com/questions/645755/differences-and-dis-advanages-between-fast-cgi-cgi-mod-php-suphp-php-fpm
- mod_php is running a PHP as Apache module - that is PHP request is run under Apache process with everything that goes with it - Apache processes are defined by Apache configuration, PHP is run with Apache permission etc.
- PHP-FPM is PHP's FastCGI implementation; PHP-FPM runs as a standalone FastCGI server and Apache connects to the server using Apache's module, usually mod_fcgid or mod_fastcgi; I personally think this is much better than running as mod_php, but it depends on your requirements and is also a little more complex; in this configuration, permission, processes related stuff & everything is run under PHP configuration, PHP user etc. & Apache connects to PHP as to a server; in this configuration it is also possible to have pool of PHP servers and to have PHP server on physically different machine than Apache. They say this is almost as fast as using Apache's module and there are benefits of better control over PHP configuration.
- SuPHP - this was mostly used to address some problems of mod_php related to permissions; with mod_php PHP scripts are run under the Apache user/group; mod_suphp can run the scripts in different user; I never used it, PHP-FPM now should be much better choice
No comments:
Post a Comment