I see most answers believe mod_php is less efficient because memory footprint will be higher due to serving static files,like this one.
But I have a different opinion as follows:
As a matter of fact,code section are shared among fork()
ed processes,so the memory footprint predicate shouldn't hold.
The only reason I can think of is that 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 fork()
overhead.
In a word,the drawback of mod_php is not its memory foot print,but the overhead of fork()
,but if mod_php
can be thread_safe,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?