MySQL space speed is slow
Answer
Ask everyone a question, I paid to rent a MySQL server virtual space, found that the speed is very slow. I use the simplest form query, every query will take more than 5 seconds, this normal?
In the database, there is only one table and two records,
Here is my test code:
$stime = Microtime (true); Gets the time that the program started executing
$db _ip = "61.152.93.83";
$db _user = ' blinnes ';
$db _pass = ' ji64edfw2 ';
$CN = mysql_connect ($db _ip, $db _user, $db _pass);
$db = mysql_select_db ("Blinn");
$sql = "SELECT * from ' Test '";
mysql_query ("Set names gb2312");
$rs = mysql_query ($sql);
while ($row = Mysql_fetch_array ($rs))
{
echo "mysql! - " . $row [' name ']. "|" . $row [' Quantity ']. "
";
}
Mysql_close ($CN);
$etime = Microtime (true); Gets the time that the program execution ended
$total = $etime-$stime; Calculate the difference value
echo "(MySQL version) This query execution time:". $total. "Seconds";
?>
Copy Code
Best answer [url=http://www.phpchina.com/bbs/space.php?username=fising] link tag Fising[/url]
[url=http://www.phpchina.com/bbs/space.php?uid=31544] link marker [img]http://www.phpchina.com/server/avatar.php?uid= 31544&size=small[/img][/url] Network connection overhead is too high. The database and the Web are best on a machine, not the best in a local area network can also.
Other Solutions
The network connection overhead is too high. The database and the Web are best on a machine, not the best in a local area network can also.
Other Solutions
Upstairs, it's very
Other Solutions
That is true. Many hosts do not even support remote connections.
Other Solutions
China Data Server Bar ~ This server has been broken, hehe
Server load is too high caused by
Other Solutions
Change the space and find a better one.
Other Solutions
Thank you all, problem solving. [Img]http://www.phpchina.com/bbs/images/smilies/default/victory.gif[/img]
It's really a server for Chinese data. [Img]http://www.phpchina.com/bbs/images/smilies/default/sleepy.gif[/img]
The estimate is that Fising said that the database and PHP is not a server reason, let them put the database space and PHP space on the same server, the speed is fast.
Other Solutions
[Img]http://www.phpchina.com/bbs/images/smilies/default/shocked.gif[/img]
http://www.bkjia.com/PHPjc/632378.html www.bkjia.com true http://www.bkjia.com/PHPjc/632378.html techarticle MySQL space slow answer ask everyone a question, I paid to rent a MySQL server virtual space, found that the speed is very slow. I use the simplest form of query, every query to use ...