The reason why mod_php is less efficient than fastcgi php(php-fpm)

admin

Administrator
Staff member
I see most answers believe mod_php is less efficient because memory footprint will be higher due to serving static files,like <a href="https://stackoverflow.com/questions...i-which-is-good-for-wordpress/1943706#1943706">this one</a>.

But I have a different opinion as follows:

As a matter of fact,code section are shared among
Code:
fork()
ed processes,so the memory footprint predicate shouldn't hold.

The only reason I can think of is that
Code:
mod_php
is non-threadsafe so that web server can only create subprocesses for each request.

While in fastcgi mode web server can boost up the performance by multiplexing tricks,thus reducing the
Code:
fork()
overhead.

In a word,the drawback of mod_php is not its memory foot print,but the overhead of
Code:
fork()
,but if
Code:
mod_php
can be thread_safe,
Code:
fork()
won't be necessary and this will be the most efficient solution to serve requests.

The above is my opinion,but not 100% sure.

Is that right?