Apache vs. IIS PHP performance comparison
Solution 1
PHP Best Practices article -- Differences between PHP on WIMP and PHP on LAMP
Some of the differences you may encounter when developing with PHP on Win/IIS vs Linux / Apache.
The most obvious difference between WIMP and LAMP is definitely performance.
For years there has been an obvious performance advantage of LAMP over WIMP.
Only recently is their even a chance of closing that gap.
There are currently 2 projects underway that may help.Currently available is IIS7 which is reported to have had PHP performance enhancements built in with collaboration from the ZEND team.
An upcoming projects involves Microsoft engineers working with PHP engineers to get the next version of PHP (PHP5.3 which is not yet available at this time) to perform much better in IIS. This will no doubt make some progress toward WIMP catching up with LAMP in performance.
Solution 2
FastCGI on IIS will significantly increase the performance and will be comparable to that of LAMP. The difference will be in details, which are hard to pick and depends on what your configuration is and on what you scripts do. For example, file access on Windows is much slow than on Linux because of NTFS's ACL checks.
There is nothing particularly wrong with the Windows web stack. The only big reason I'd think of using Windows over Linux when human experience doesn't matter would be SQL Server. Otherwise WAMP, WIMP and LAMP perform comparably and performance differences won't show up until heavy load.
Related videos on Youtube
misteraidan
Just another programmer pumping more bad code into the world. But I'm working on it!! They just don't give me enough time.
Updated on July 09, 2022Comments
-
misteraidan almost 2 years
Does anyone know of any links to realistic performance comparisons of IIS vs. Apache for PHP hosting?
I am looking to utilise existing infrastructure for a change of technologies from .NET to a PHP application but I cannot find any information about PHP hosted on varying platforms. There is heaps out there about IIS vs. Apache in general, or ASP.NET vs PHP .. or any other language server vs server, language vs language but no server/language vs server/language.
My current direction is to use PHP with FastCGI.. looks pretty good. Just need to justify it or find a compelling reason to reject the big cuddly MS monster that I'm used to.
UPDATED
Windows environment would be Win2k3 running IIS6 with FastCGI serving the PHP extension. Also planning to use eAccelerator or similar script cache.
-
Ian Selby almost 15 yearsFound this article: webhostingfan.com/2009/07/apache-vs-iis-web-server May help a bit :)
-
Pascal MARTIN almost 15 yearsAre you really 100% bound to Windows and IIS/Apache ? Would you try alternatives, as Linux and/or Lighttpd or nginx ? Also, what about using a reverse proxy (like varnish) in front of your web server ?
-
misteraidan almost 15 yearsI'm not 100% bound to anything - but obviously the first option is the road more travelled.. which for me is Windows based. The purpose of the question is to gain information on the best alternative. Again, I don't necessarily need Apache on Windows either .. anything goes.
-
misteraidan almost 15 yearsTo be fair, I must admit that I am 90% bound to Windows server however. As the post says, "existing [and contracted] infrastructure"
-
Carlos Aguilar Mares over 13 yearsMake sure to use WinCache whenever you run PHP on Windows, it will increase SIGNIFICANTLY your performance, it is built by the IIS Team and its a must for high perf see: blogs.msdn.com/b/kjsingla/archive/2009/09/20/…
-
-
misteraidan almost 15 yearsGreat, I've found a lot saying that IIS7 performs as well, if not better. Was this not due to Microsoft picking up FastCGI? Does FastCGI return the same performance on 2003/IIS6? (It's becoming obvious to myself that I'm looking for a single piece of decent evidence for me to check the box and continue down that path)
-
Carlos Aguilar Mares over 13 yearsFastCGI and WinCache increase performance on Windows significantly. If using IIS 7 you can leverage even more performance features such as Kernel and User mode caching, compression and more that will yield really good performance.
-
ryanm over 6 yearsPlease note the referenced article is from 2009, when it says "PHP5.3 was not yet available". A lot has changed in the web & PHP world since then. It would be most helpful to get some recent / updated answers to this question.