Bug #54212 [Opn]: Localhost resolves much more slowly than 127.0.0.1 on mysql_connect()

From: Date: Thu, 10 Mar 2011 09:53:14 +0000
Subject: Bug #54212 [Opn]: Localhost resolves much more slowly than 127.0.0.1 on mysql_connect()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159361@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54212&edit=1

 ID:                 54212
 Updated by:         uw@php.net
 Reported by:        kriscraig@php.net
 Summary:            Localhost resolves much more slowly than 127.0.0.1
                     on mysql_connect()
 Status:             Open
 Type:               Bug
 Package:            MySQL related
 Operating System:   Windows
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

If there is anything, its not MySQL specific. mysqlnd is using PHP
Streams. PHP Streams should be the source. Only other cause I can think
of is MySQL server.


Previous Comments:
------------------------------------------------------------------------
[2011-03-10 10:45:51] kriscraig@php.net

Description:
------------
I'm told that a number of people have been reporting this issue.  The
reports I'm hearing state that people are finding it to be about 3-4
times slower when done by hostname.

My guess would be this is another IPv6-related issue.  It's also worth
noting that I have not yet been able to independently verify these
numbers, though I am working on doing so and will post the data if/when
I have it.

It was requested that I post this bug so that we have a record of it. 
If you've experienced any hostname vs. IP performance issues (good or
bad), please post a comment here so we have the reports in one central
place.  Thanks!

Test script:
---------------
<?php

if ( !isset( $_GET["host"] ) )
{
	die( "You must specify ?host= in the URL string.  Example: 
mysql_connect_test.php?host=localhost" );
}

$start = microtime( TRUE );

$link = mysql_connect( $_GET["host"], "root", "(your-password-here)" )
or die( "Function mysql_connect() failed." );

$end = microtime( TRUE );
$duration = $end - $start;
print "<b>Execution Time:</b>&nbsp; $duration sec<br />\r\n";




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54212&edit=1


Thread (7 messages)

« previous php.bugs (#159361) next »