IIS and Apache web server are two of the most popular web developing platforms, but which one has more advantages and works better with our website? I did a lot of research on the web and setup local environment directly to find out the difference.
Because a user friendly GUI is always expected for programmers, windows is always the primary consideration. So we have the chance to test out the software's overall performance and stability etc.
Here're the platform and softwares specification used for testing — Xeon and Core2 E6 CPU. 2GB RAM with both windows server 2003 and Centos 5.4 Installations. The web server environment are — Windows + IIS 6.0 + PHP and Windows + Apache + PHP and Linux + Apache + PHP
Scripts used for testing: one 40K static HTML page and a basic phpinfo page. Tools for server testing: Web Capacity Analysis Tool (WCAT). Testing time: One minute.
WCAT download link: http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1466
What's the testing result?
Under both server environment (IIS), I opened about 100 threads to the HTML file and found out the E6 CPU be able to handle 5 requests/s while the Xeon can reach up to 30 requests/s! After stopping IIS and switch to Apache, the testing resutls are similar.
Now turns to test the basic php page(windows server). When I increase the threads for both IIS/apache sites, the apache RAM usage is pretty high comparing to IIS server. At the meanwhile, IIS can keep an average usage and keep running, however, the apache is finally dead. But such issue doesn't happen under the Centos environment.
So I get the basic conclusion — IIS/Apache have similar abilities to handle static files under the same hardware specs/OS, hardware would be the bottleneck for performance downgrading. But for dynamic pages, apache is definitely not a good choice under windows OS.
How to improve the website performance?
Based above testing results, we found there're several factors to affect the website actual performance — Hardware specs, Server OS, Types of scripting language
So here're the solutions
If we're doing PHP scripting on our website, do not apache running on your production windows server. IIS is absolutely the best one for windows OS. Secondly, always try to avoid using dynamic pages on the website. With the current website technologies, it's easy to convert any dynamic page to static one. The popular module for apache mod_rewrite is highly suggested to activate.
How about web hosting environment?
Obviously, above rules are still valid for hosting purpose. But there're more. The hosting industry is already a mature market and many new companies are joining in every day. We can't find which is good and which is not without any actual experience with them.
Generally speaking, all quality web hosting companies have up to date hardware & OS installations on hosting server and they have a professional tech team to optimize it based on live experience. But it's another story to less quality service providers. There might be a more attractive price with lots of promotional offers, but you can't find too much info about their service on internet, such company is either too new or simply rubbish to disturb our decision.
When we evaluate a web hosting provider, always remember to contact their pre-sales support to confirm the server and network specifications. Also ask around for other users' experience in web forums or blogs. No matter how much time it cost to learn about, it's valuable to avoid future problems with the service.