|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-03-10 10:45 UTC] 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> $duration sec<br />\r\n";
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 07:00:02 2025 UTC |
We need: - windows version - Whether IPv6 is enabled or not Please try using simple socket as well, or using fopen('http://localhost/foo.php'); while being sure that localhost is actually IPv6 or Ipv4, to compare both. That will let us diagnose the issue without having to rely on mysql.