Why is FastCGI /w Nginx so much faster than Apache /w mod_php ? – ESchrade – Kevin Schroeder

/why-is-fastcgi-w-nginx-so-much-faster-t

  • Why is FastCGI /w #Nginx so much faster than #Apache /w mod_php? – ESchrade – Kevin Schroeder

    http://www.eschrade.com/page/why-is-fastcgi-w-nginx-so-much-faster-than-apache-w-mod_php

    I had heard a while ago that NginX running PHP via FastCGI was faster than Apache with mod_php and have heard people swear up and down that it was true.Today I wanted to examine it more in depth and see if I could get some good numbers on why this was the case. The problem was that I couldn’t.

    Then I remembered that I had AllowOverride (.htaccess) turned on. So I re-ran the test with AllowOverride set to None.

    This all makes sense. mod_php has PHP embedded in Apache and so it should be faster. If you’re running only PHP on a web server then Apache still seems to be your best bet for performance. And if you are seeing a significant performance difference then you should check if AllowOverride is turned on. If it is, try moving that into httpd.conf and try again.

    If you are running mixed content, such as adding CSS, JS and images, then NginX will provide better overall performance but it will not run PHP any faster. It will also respond better to denial of service attacks better. But if you are running pure PHP content on a given server, Apache seems to still be the best bet for the job.