ID: 48051 Updated by: scott...@php.net Reported By: bouddhagod at hotmail dot com -Status: Open +Status: Bogus Bug Type: Performance problem Operating System: Gentoo PHP Version: 5.2.9 New Comment:
This is probably firewall related or dns related. Nothing to do with PHP here. Previous Comments: ------------------------------------------------------------------------ [2009-04-22 16:09:10] bouddhagod at hotmail dot com If I put localhost all work fine. ------------------------------------------------------------------------ [2009-04-22 15:47:26] bouddhagod at hotmail dot com 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"; ------------------------------------------------------------------------ [2009-04-22 15:39:17] 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 ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48051&edit=1