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

From: Date: Thu, 10 Mar 2011 09:45:52 +0000
Subject: Bug #54212 [NEW]: Localhost resolves much more slowly than 127.0.0.1 on mysql_connect()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159360@lists.php.net to get a copy of this message
From:             kriscraig
Operating system: Windows
PHP version:      5.3.5
Package:          MySQL related
Bug Type:         Bug
Bug description:Localhost resolves much more slowly than 127.0.0.1 on mysql_connect()

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 bug report at http://bugs.php.net/bug.php?id=54212&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54212&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54212&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54212&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54212&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54212&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54212&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54212&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54212&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54212&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54212&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54212&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54212&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54212&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54212&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54212&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54212&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54212&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54212&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54212&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54212&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54212&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#159360) next »