Home  >  Article  >  Operation and Maintenance  >  Detailed explanation on the solution to the slow speed when running asp in win2008 R2 and sql2005 and 2008

Detailed explanation on the solution to the slow speed when running asp in win2008 R2 and sql2005 and 2008

黄舟
黄舟Original
2017-05-31 10:35:232164browse

This article mainly introduces the solution to the slow speed when win2008 R2 and sql 2008 run asp. Friends in need can refer to

using SQL Server 2005 database as the background The access speed of the ASP website is slow. The situation is as follows: There are two ASP websites on one server, one is accessed very quickly and the other is very slow.

Things and steps for troubleshooting:

First, open these two websites in sequence on my computer. One opens in two or three seconds, and the other takes 10 seconds. bell. It seems that the problem is true;

Log in to the server and open the two websites in the local IIS of the server. The result is that one is faster and the other is slower. This excludes the impact of DNS resolution time and network;

Open the homepage ASP files of the two website programs and find that the website with fast access does not have a database Query, and the website with slow access has queried the database. Since the database query statements in the program are also very simple, problems with the program and database query statements are eliminated, and finally the problem is located on the database SQL Server;

Open SQL Server 2005 and there is only one database on it. Two complex query statements were executed on Management Studio, and the speed was very fast. It did not seem to be a problem with the database query speed.

The system CPU and memory load are not high. I really can't find the reason. Just open the command prompt and use netstat-ano to check the network connection. It was found that only the 1434 port of sqlserver was listening, but there was no 1433 port of sqlserver listening and connecting. However, why could the website be accessed even though there was no monitoring or connection. Wondering if sqlserver has modified the listening port.

Open the SQL Server Configuration Manager of SQL Server 2005 SQL Server 2005 Network Configuration->MSSQLSERVER Protocol->TCP/IP and find that TCP/IP is disabled in the protocol Only Shared Memory is enabled. PropertiesThe listening port set in it is the default 1433. So TCP/IP is enabled. After restarting the SQL Server service, the speed of opening the website is very fast.

The problem is finally solved. The reason is that the TCP/IP protocol in SQL Server is not turned on and Shared Memory is used to connect to the database, so website access is very slow.

The following are the supplementary methods from other netizens:

Recently encountered a WEB server hard disk failure, and because the server had been running for 10 years, the WEB service was replaced. On a new server, various problems occurred after the migration. Here is a summary of the problems and solutions:

Windows2003+asp+sqlserver2000 New WEB server:

Windows2008R2+asp+SQL Server2008

Website After all the files and databases were migrated, opening the homepage, content page, and backend was normal. However, I found that the page for signing a file opened very slowly and sometimes could not be opened.

After checking the code, everything was normal and I couldn't find the reason. It felt like a problem when querying the database. Then Baidu found that the database used the memory shared connection mode, so I changed the database to the TCP connection mode. This It can be turned on, but it's still slow, taking about 5-8 seconds.

Continue to look for solutions online. Some people say that the database is not closed after querying. I have tried various methods. The last article helped me solve the problem in just a few sentences. The reason was that the database connection statement was incorrect.


The original connection statement is:

Provider=Sqloledb;User ID=数据库帐号;Password=数据库密码;InitialCatalog=数据库名;Data Source=数据库IP;
There is no problem with this statement under the original server, but it does not work under the new server environment.

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

Driver={SQL SERVER};Server=数据库IP;UID=数据库帐号;PWD=数据库密码;Database=数据库名;

The above is the detailed content of Detailed explanation on the solution to the slow speed when running asp in win2008 R2 and sql2005 and 2008. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn