Link to home
Start Free TrialLog in
Avatar of Ryan Rood
Ryan RoodFlag for Canada

asked on

IIS7 Slow Rendering PHP/MySQL Webpages

Hi Everybody,

I am hoping for some expertise with IIS 7.x. I have read through many IIS docs and according to what I have seen IIS should perform as well as Apache (Linux) in the later version (like IIS 7).

The issue is that the pages are taking a long time to load ... causing some frustrations.

What can I do?

I have compression turned on, static and dynamic. I have gone through the recommendations that IIS recommended.

I am at a loss for what else I can do.

Website (IIS7): http://www.coppsbuildall.com
Dev Site (Linux): http://dev.arcane.ws/copps

As a side note - the developer removed all the DB calls (MySQL) and loaded everything straight through a PHP page and it loaded lightning fast ... perhaps this is a DB issue?

Thoughts?

Any help or suggestions would be greatly appreciated.

Thanks,
Ryan
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Right now, http://www.coppsbuildall.com/ isn't loading at all.
Im getting hit and miss with http://www.coppsbuildall.com. It either times out or gives me a internal 500 error.

Looks like it is database related to me, I would trying turning off dynamic cache while testing, it can wreak havoc on dynamic code sometimes.

Check your IIS logs to see if you can get anymore info on the errors being generated.

Where is the sql database located in relation to this server?
Avatar of Ryan Rood

ASKER

Sorry everybody - the host is having issues. Normally it does load - within 15-30 seconds. I will post again once the issues have been resolved.
One thing to note about IIS is that if the website is not accessed for, i think its 15 minutes, IIS will shutdown the application pool.

So when then next user goes to access the website, IIS will restart the pool but can take a few extra seconds to get going. This however will only be the case for the first user going to it, once its started you should get a quicker response.
Ok - it seems to be responding as per usual now.

DB = MySQL (Local)
According to this page http://www.uptrends.com/aspx/free-html-site-page-load-check-tool.aspx , it took 10 seconds to load the initial page and then another 4 seconds to load the next 180 files for that page.  157 images, 4 style sheets and 18 scripts.  That is an incredible number of files for one page.
I agree with you - it is a lot. But if you look at the dev site - same site ... couple of images are missing from it - but it loads 2-4 times faster than the one on a VPS. Seems to be an IIS, PHP or MySQL issue.
You can also take a look at http://www.coppsbuildall.com/test.php ... it is the test file that the dev company gave to proove that it was not a coding issue but rather a server issue.
Yep, you might want to change hosting.  This time get a company with servers closer to your clients.
I don't think that the distance is the issue. It would seem that it is an IIS issue or a PHP/MySQL issue ... perhaps I don't have it tuned appropriately.
It is probably a MySQL issue.  I have never seen a hosting company fix an issue like this.  What have they said about it so far?
They point to the code and say that it is my responsibility.

Is there test scripts that I can try on the server to determine how quickly it is responding to queries through IIS?
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One is sitting on a server in the US (primary site) and the dev site is on a server in Toronto. DB was copied from the primary server to the dev site once we realized we were having some issues.

The VPS was pre-configured - Server 2008 R2 Datacenter, IIS7, PHP 5.2.17, MySQL 5.1.56

The VPS is my responsibility and the dev site is from the original creators.

2x 2.4GHz, 2GB ram. CPU is normally spiking to 50% on multiple requests. RAM sits at less than 50% and never exceeds.
2 Gb is not a lot of RAM for a Windows Server, especially when you start running SQL on it. The total commit might only be 50%, but that could also mean it is utilizing the page file more resulting in slower performance. You might be able to get away with 2 Gb on the Linux side, but I would suggest 4 Gb for Windows. That could be part of your issue.

I still think the majority of the issue is related to the DB. How do you move it from one server to the other? Was it import/exported or were the data files moved around?

The versions of PHP and MySQL also seem to be a bit dated, what versions were in use on the Linux box?
Those are the versions of PHP and MYSQL I have on my Godaddy Windows IIS7 shared hosting account and there is no noticeable delay on my pages.
hit_rot: The DB originated on the live server - it drops every night and rebuilds itself. Originally it was exported and re-imported on the live server.

This is running on top of Plesk Parallels. Unfortunately the PHP/MySQL versions won't change until they update their software again.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I should have updated last week - we subscribed to a Linux VPS and sure enough the speed immediately improved. We are now seeing load times around 1-2s for the initial load and only a few more seconds for the rest of the page to load. Seems that IIS 7.5 is still nothing compared to Apache + PHP + MySQL on Linux.

So to any developers out there - DO NOT USE CONCRETE (CMS) on a Windows host. Either it is to much for Windows to handle or it just isn't written properly to support it.
Glad you figured something out! :)

IIS 7.5 is a solid web server and has come a long way. IIS really shines on Microsoft products and languages(as you would expect)! It's also hard to beat on a Domain if you need a WS. I am not a huge fan of Microsoft languages or SQL, and I quickly found out getting into IIS that php has never really ran as fast as asp. Although 7 is supposed to be vastly improved.

I've used php and mysql on Server 08 with Drupal and Wordpress. Both run good but I had to do a lot of configuring to IIS to really get it running really good. Then I ported it to centos (VM w/ 2GB RAM, 4GB for server 08) with apache/mysql, definitely got more consistent performance right out of the box, linux and its administrators are just a different breed :)