56741

ADO and msqli connections very slow

I am experiencing a very slow ADO and mysqli connection for my production web server. The current software setup is windows 2008 server R2 Standard Edition SP1, Apache 2.4, PHP 5.3.10, MySql 5.5.24, Pear 1.94, Zend Engine version 2.30.

I've profiled the code using XDEBUG and it shows the initial connections taking around 1200ms each (regardless of page being visited), whereas on my local development machine and another test server the connections only takes around 8ms. The code for the website is all in sync through SVN except for the php, pear, mysql, and apache ini and conf files. I've done diffs on these to check for differences and there aren't any. The DB contents are a complete copy as well. Everything for the production server is hosted on the same machine so there aren't any firewall or internet issues.

The first connection profile has the following call stack:

ADOConnecton->Connect ADODB_mysql->_connect php::mysql_connect

The second one:

php::mysqli->mysqli

Any suggestions?

Answer1:

Usually the slowness in (first) connection depend on DNS resolution. May be:

    <li>client to resolve the server name</li> <li>server to resolve the client name to match an access rule</li> </ul>

    let the client/server let know the server/client address using the host file: http://en.wikipedia.org/wiki/Hosts_(file)

    Answer2:

    I edited the Mysql my.ini to change the mysql service to only bind to the IPV4 loopback adapter.

    [mysqld] ... bind=127.0.0.1

    I also changed the \public_html\conf\face.ini to use the IPV4 loopback address instead of local host. (Changed "localhost" to "127.0.0.1")

    After that all issues went away. I'm not sure if it is because the machine has a half dozen IP addresses or its trying to decide whether to use IPV6 or IPV4.

Recommend

  • How to reduce Ipython parallel memory usage
  • perf report showing “__libm_pow_l9”
  • @jit slowing down function
  • Launching xdebug in Eclipse stuck at 57% - How to trouble-shoot? [duplicate]
  • After Upgrade To JRuby 9.1.9.0, Rails CookieStore Very Slow When Handling Encrypted Cookies
  • how install openssl for php 5.3.5 on windows xp?
  • Xdebug installed but does not display in Phpinfo for Xampp
  • 2d array, all values are adjacent
  • Shortest path in a grid
  • Remote debugging of a Java application launched as a Windows service
  • What products support 3-digit region subtags, e.g., es-419 for Latin-American Spanish?
  • Why does Sencha 2 only work in Webkit browsers?
  • Is there a package like bigmemory in R that can deal with large list objects?
  • How Get arguments value using inline assembly in C without Glibc?
  • Azure webjobs output logs indexing taking very long
  • Custom preprocessing in caret
  • Can I programmatically choose the Android layout folder?
  • Graphics.CopyFromScreen [Web application] + The handle is invalid
  • Does Mobilefirst provide a provision to access web services directly?
  • How to use JavaScript to determine whether a file exists in a directory?
  • Marklogic : Query response time is very high
  • PHP buffered output depending on server setting?
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • Scrapy recursive link crawler
  • Display issues when we change from one jquery mobile page to another in firefox
  • Deselecting radio buttons while keeping the View Model in synch
  • javaw.exe and eclipse startup problems
  • JSON with duplicate key names losing information when parsed
  • htaccess rewriting URLs with multiple forward slashes
  • Display Images one by one with next and previous functionality
  • Web-crawler for facebook in python
  • Jquery - Jquery Wysiwyg return html as a string
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • A cron job substitute?
  • Acquiring multiple attributes from .xml file in c#
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • costura.fody for a dll that references another dll
  • java string with new operator and a literal