Database server and Web server is separate, now from the site server side of the data is relatively slow, what reason???
First, determine whether the network between the server is not a problem
You can simply ping the database server on the Web server (in turn, you can), the general ping out of the results in milliseconds indicates that the link is very stable, more than 3 seconds to prove that there is a problem
As for the detection of the network speed between the server, you need to use special tools to test, you can refer to
HTTP://JINGYAN.BAIDU.COM/ARTICLE/08B6A591C9CAF714A9092245.HTML?QQ-PF-TO=PCQQ.C2C (the method of this page has not been tried, not sure whether it is correct)
Second, confirm the number of queries, the complexity of the statement there is no problem
If the statement is more complex, or more than the number of queries, such as the site to check thousands of at a time, assuming 3,000, each record 10K large, that there is 3 m of data traffic, compared to the database server query without the kind of traffic
, the difference between fraction seconds is very normal, but if the query speed is more than 2 seconds to check whether the SQL statement is a problem , or can not query so much data at once
Third, the program calculation time is more
Query out after the site program will have some calculations, perhaps the program has optimized space
Iv. confirm that the database server has no problems
How to confirm: Not clear at the moment, but you can optimize the database by reducing database IO operations, optimization, indexing, etc.
V. In addition
Can try to make the site server with the database server in the same room, so that transmission can be transmitted through the Intranet, and with some detection tools to confirm the speed, will be more excellent
Slow transfer between database server and Web server