IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue. [Answered]RSS

12 replies

Last post May 04, 2010 01:33 AM by yourguide

  • IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    Mar 05, 2010 04:06 PM|yourguide|LINK

    Hello folks....

     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.

     

    Any ideas?

    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.

    Thanks!

     

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    Mar 05, 2010 08:00 PM|don.raman|LINK

    Hi,

    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.

    Thanks,

    Don.

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    Mar 06, 2010 01:11 AM|yourguide|LINK

    Tried changing connections to use 127.0.0.1. Bu am getting same results. Any other ideas? Thanks for your help.
  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    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.

    Thanks,

    Don.

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    Mar 06, 2010 01:46 AM|yourguide|LINK

    127.0.0.1 is a loopback address. It's always the same as your address. I went ahead and tried the actual ip.... Getting same result. Methinks it's not a DNS issue.
  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    Mar 06, 2010 10:19 AM|don.raman|LINK

    Hi,

    Can I get a sample code which I can look at and debug.

    Thanks,

    Don.

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    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://66.119.8.187/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.

    Thank you for you help with this.

     

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    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?

     

    Thanks.

     

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    Mar 18, 2010 04:21 PM|don.raman|LINK

    Hi,

    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.

    Thanks,

    Don.

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    Mar 23, 2010 10:34 AM|bj1126|LINK

    I am getting the exact same behavior. My MySQL database is on a separate server and I am connecting via IP. The page waits a few seconds then the whole thing loads. Running just normal php is lightning fast but as soon as I start accessing MySQL it adds a delay. I have a wordpress blog setup now and can PM you the url if you want to look at it. The behavior exists in Joomla, Wordpress, anything that accesses the database. Edit: Problem resolved and I feel like an idiot. skip-name-resolve wasn't added to my MySQL config file. I could have sworn I added it but on a whim I did a find on it and it didn't show up.
  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    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.

     

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    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.

    Thanks,
    Kanwal

  • Re: IIS6 PHP MySQL --> IIS7 PHP Mysql Performance issue.

    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.

    <div class=ForumPostContentText>

    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.

    Does that help anyone ?   I would prefer the way it used to do it on the old server... since I wrote javascript code that displayed a "Loading....." until the page was built... but at least the user got an immediate response.

    Thanks again everyone for all these suggestions!

    </div>