IIS 7 and Above
IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.
Last post May 04, 2010 01:33 AM by yourguide
Mar 05, 2010 04:06 PM|yourguide|LINK
Well the server migration is complete.... I finally have all my code working on the new IIS7! Thank you for your help.. your posts and this forum have been indespensable.
OK... so now that all my code works... I am having the strangest issue with PHP pages that pull data from my MySQL database hosted on the same machine.
I click on a page... it sits there for a few seconds... then it pulls everything up quickly.
On my old server IIS6.. it would go right to the page... then take a few seconds to pull up the data.
The new server is MUCH faster.... if I run the MySQL code directly using PHP Myadmin it's WAAAY faster... but when I access my pages I get that delay.
I have tried tweaking all the options for php.ini and MySQL's my.ini... but I really feel like this is an IIS7 issue.... it's still working great on my IIS6 server.
Mar 05, 2010 08:00 PM|don.raman|LINK
Are you using IP address to connect to the database? Or host name (like localhost). If you are using host name, please change it to IP address and see.
Mar 06, 2010 01:11 AM|yourguide|LINK
Mar 06, 2010 01:15 AM|don.raman|LINK
Hmmm.... 127.0.0.1 is not your ip address. Use the command ipconfig to figure it out and use that.
Mar 06, 2010 01:46 AM|yourguide|LINK
Mar 06, 2010 10:19 AM|don.raman|LINK
Can I get a sample code which I can look at and debug.
Mar 06, 2010 04:17 PM|yourguide|LINK
That would be really hard to do... the process is quite complicated.... but I just noticed something else strange.
If I run a query directly via PHPmyadmin it is super fast.... yet my page that runs the same query has the lag before it runs.
I also turned on Query caching... and now the first query does the slight lag... but everything after that is super fast.... so does that mean the slow-down is within MySQL??
Also the code is currently running on both an IIS6 and IIS7 server... and it runs fine on the IIS6 machine... unless you are thinking I might need to modify my code between IIS versions... Also PHP version is different too... IIS6 - 5.1.2 IIS7 - 5.2.13
think I should look there?
Here you can see it first hand:
Old Server: http://220.127.116.11/newsearch.php?search=ProductLine:LMIN&smartsrch=yes&page=6
New Server: http://atrlighting.com/newsearch.php?search=ProductLine:LMIN&smartsrch=yes&page=6
Now if you follow those links you will see what I am talking about... the IP address is the IIS6 server... and the page comes up immediately...but takes a long time to load completely.
The atrlighting.com server is IIS7 and the page doesn't come up immediately... but then loads all at once.
Clicking to go forward to the next page is the only way to see it after the initial load... because after that it is Cached on the server end... so just keep clicking the --> arrow to go forward and you will see it over and over.
What I am trying for here is the absolute fastest response after a click.
Mar 18, 2010 03:54 PM|yourguide|LINK
Don... thank you for all your help on this... I just installed wincache and set it up... I thought things were faster... but I think it's still doing the same thing.
I am not sure how to show you my code... I dont mind sending you all my code.... but posting it to this forum would be quite a bit.
Are you still interested in troubleshooting this situation?
Mar 18, 2010 04:21 PM|don.raman|LINK
Thanks for installing WINCACHE. This will fasten your PHP application. But since you are seeing database problem, WINCACHE will not help solving that. Can you try a simple code like connect to database and query something and see if this is slow too. A small
repro will definitely help me a lot.
Mar 23, 2010 10:34 AM|bj1126|LINK
Apr 08, 2010 03:53 PM|yourguide|LINK
Still haven't figure out anything on this issue.
Been searching High and Low... Can't pinpoint what's up... am going to try to set things up on a new Machine and see if I get same results.
Apr 08, 2010 05:00 PM|ksingla|LINK
Can you try disabling response buffering and see if you get the old behavior back? Buffering will make IIS to stop sending the response unless full response is available or unless buffer is full. To disable response buffering, you need to set responseBufferLimit for
the php handler to 0. Read more about this
here. Let me know how it goes.
May 04, 2010 01:33 AM|yourguide|LINK
Since I still can't get this to work.. I would LOVE to try what you mention... but I have looked all over the Handler Mappings, etc. and can't figure out how to set response buffering to 0.....
I don't even see the option....
I must be looking in the wrong place.
Please direct me... on that page you link to I only see one section that says "responseBufferLimit" but like I said I have never been able to find that option.
I just ran some tests and I am now positive it is a MySQL thing... not a PHP thing.
I turned on MySQL query caching and the pages come up fast the second time (cached) so that must mean that it had something to do with my queries.... I am guessing they are just too complicated or something...
Although I new this before, it seems between my old server and my new one that MySQL queries are handled differently.... on the old server it would slowly build the page before my eyes on a none cached query.... on the new it just waits until the page is
built and shows it all at once.
Thanks again everyone for all these suggestions!