win2008 R2 and sql 2005 2008 asp running slow solution

  • 2020-06-12 11:16:46
  • OfStack

In the SQL Server 2005 database as the background of the ASP website access speed is slow, the situation is as follows: 1 server on two ASP website, 1 access fast, 1 slow.

Thoughts and steps of cause investigation:

First, I opened the two websites in turn on my computer. One took two or three seconds to open, and the other took 10 seconds. It appears that the problem is true;

Log in to the server and open the two websites respectively in the local IIS of the server, but the result is still one is fast and the other is slow, excluding the influence of DNS parsing time and network.

Open the ASP file on the front page of two website programs, and find that the fast website has no database query, while the slow website has database query. Because the database query statement in the program is also very simple, the problem of the program and database query statement is eliminated. Finally, the problem is located on the database SQL Server.

Open SQL Server 2005 on the above one database, SQL Server Management Studio randomly on SQL Server Management Studio executed two complex point query statement, the speed is very fast, does not feel like a database query speed problem.

System CPU, memory load is not high. I really can't find the reason. Open the command prompt and check the network connection with ES29en-ES30en. It was found that only PORT 1434 of sqlserver was listening, but no port 1433 of sqlserver was listening and connecting. However, how could the website be accessed without monitoring and connecting? Wonder if sqlserver modified the listening port.

Open SQL Server2005's SQL Server configuration manager SQL Server 2005 network configuration - > MSSQLSERVER agreement - > TCP/IP, TCP/IP is actually disabled, the protocol only opened Shared Memory. The default listener port is 1433. TCP/IP is enabled. Restart the SQL Server service and the site will be very fast.

The problem is solved. The reason is that the TCP/IP protocol in SQL Server was not opened, and the way of Shared Memory was used to connect to the database, so the website access was slow.

Here are some tips from others:

Recently, I encountered the hard disk failure of one WEB server. Because the server had been running for 10 years, I changed the WEB service to a new server. However, various problems occurred after the migration.

Windows2003+asp+sqlserver2000 new WEB
Windows2008R2+asp+SQL Server2008

After the website and database were all transferred, the front page, content page and background were all normal. However, it was found that the page signed for by one file opened very slowly and sometimes could not be opened.

After checking the code 1, I could not find the reason, which seemed to be the problem of database query. Then baidu 1 said that the database used the memory Shared connection mode, so I changed the database to TCP connection mode, which could be opened now, but it was still slow, about 5-8 seconds.
Continue to look for solutions on the Internet, there is a database query is not closed, a variety of methods have tried, the last article just a few words let me solve the problem, because the database connection statement is wrong.

The original join statement is:

Provider = Sqloledb; User ID= database account; Password= database password; InitialCatalog= database name; Data Source= database IP;

This statement works fine on the existing server, but not on the new server.

The solution is to replace the connection statement with the following:

Driver = {SQL SERVER}; Server= database IP; UID= database account; PWD= database password; Database= database name;


Related articles: