|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-04-22 15:39 UTC] bouddhagod at hotmail dot com
Description: ------------ I made a connection to a mysql server. The first time i load the page all look fine. It take about 3500 - 400 ms to do the jog. The second time I load the page ( it's a login screen ) the same mysql_connect take about 5-6 sec. Thoses 2 servers is located on the same computer ( dual xeon 2.4 with 1.5 gig of ram ). So I'm sure it's not a hardware problem. Any suggestion ? Reproduce code: --------------- mysql_connect( "192.168.1.100", "username", "password"); Expected result: ---------------- not 5 SEC to responde... Actual result: -------------- first loading : 300 ms second loading : 5 SEC third loading : 300ms fourth loading : 5 SEC Etc ... PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 19:00:01 2025 UTC |
function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); $tutu = mysql_connect("192.168.1.100" , "user" , "password"); mysql_close($tutu); $time_end = microtime_float(); $time = $time_end - $time_start; echo "Did nothing in $time seconds\n";