Drupal on IIS or Apache

Drupal on IIS or Apache

Piece of Cake

In this article I will try to find out if there is any performance lead in running Drupal on IIS over Apache. I will not run any benchmarks on my own (for the moment), just analyze what I could find about this surfing the web. Type "iis vs apache drupal" in Google and this is what I found.

The links

Drupal Performance on IIS7 vs Apache

Date: Mid 2012

This is a discussion in drupal.org groups that, after some back and forth in the testing setup, ends up pointing to a 100% more requests per second using Apache Benchmark when comparing IIS on Windows Server 2012 vs Apache on CentOS, both running on virtual boxes.

Drupal on Windows: Making the Case for IIS over Apache

Date: Mid 2012

In this article they compare IIS vs Apache, both on Windows. Results range from a 200% to 400% page load time improvement on cold caches, and around 50% better with hot caches.

The author points out at the end of the article that the performance benefits might not compensate the elevated costs of Windows licenses. As of 2015, "cloud wars" have lead to reduce the price difference between a Linux and a Windows cloud box, and actually Windows boxes are cheaper to maintain (that's what you pay Microsoft for, right?). Some research also points out that Microsoft hosting has a rough 20% TCO (Total Cost of Operation) than Linux.

Which Web Server: IIS vs. Apache

Date: Sept 2013

In this brief article they do no benchmarks, and simply point out to some operational differences between running LAMP. This is what they say:

Apache and LAMP have several principle advantages:

  • Lower costs, since there are no software licensing fees
  • Programming flexibility due to the open source
  • Enhanced security. Since Apache was developed for a non-Microsoft operating system, and the majority of malicious programs have traditionally been written to take advantage of vulnerabilities in Windows, Apache has always enjoyed a reputation as a more secure option than Microsoft’s IIS.

I deeply disagree with this. LAMP has higher operational costs than Windows systems, it is more difficult to maintain and troubleshot. Open source also gives no "programming flexibility edge", unless you plan on touching Apaches's or Linux's source code yourself, which I highly doubt you will do if your business is making web applications. Regarding security, it is true that Windows has been a traditional target for malware, but that does not mean that it is less secure. Indeed, being a main target for hackers and being a commercial product, it has been in need to heavily invest in security. The only security issues I have truly come across in Windows boxes are due to inexperienced people doing unsafe things, this type of highly inexperienced user is practically non-existent in Linux so we are talking about different things here.



  • All the sources point to IIS as a clear winner, but I would like to see more serious benchmarking.
  • Many of these articles are a few years old, and Microsoft has made big investment in improving PHP support on IIS through the Wincache Extension.
  • TCO (Total Cost of Operation) for Windows vs Linux is an historical battle with no clear winner, but it is worth mentioning that in 2015 the cost of a Windows Cloud Box vs Linux Cloud Box is roughly the same. In rackspace the same Virtual Machine running windows is only 25% more expensive than its Linux brother, and given the easy of operation and maintenance of Windows over Linux, you will easily save that 25% in human hours.
  • No matter what, I recommend either going for IIS on Windows or Apache on Linux, but never for Apache on Windows for production environments (stay away from the WAMP stack at all costs unless you are toying). Indeed I don't see any point in running Apache on Windows, your windows license has an IIS server included for free, so any argument favoring apache in that situation is gone.

Just to make this clear:

  • If you are on Windows use IIS
  • If you are on Linux/Unix systems use Apache/Nginx
  • Never use Apache on Windows

As a bonus, if you deploy your application on the MS stack you get full access to the .Net Framework from your PHP application thanks to NetPhp.

A piece of code writen in C# like this:

string javascript = "";
Microsoft.Ajax.Utilities.Minifier m = new Microsoft.Ajax.Utilities.Minifier();
Microsoft.Ajax.Utilities.CodeSettings settings = new Microsoft.Ajax.Utilities.CodeSettings();
settings.OutputMode = Microsoft.Ajax.Utilities.OutputMode.SingleLine;
settings.PreserveFunctionNames = false;
string minified = m.MinifyJavaScript(javascript, settings);

Will look like this on PHP:

$minifier = netMinifier::Minifier_Constructor();
$settings = netCodeSettings::CodeSettings_Constructor();
$csssettings = \ms\Microsoft\Ajax\Utilities\netCssSettings::CssSettings_Constructor();
$result = $minifier->MinifyStyleSheet($css, $csssettings, $settings)->Val();

Add new comment

By: david_garcia Sunday, January 11, 2015 - 03:38