IIS 7.5(Windows 7)下的ASP.NET网站运行非常慢 [英] ASP.NET websites under IIS 7.5 (Windows 7) running extremely slow

查看:162
本文介绍了IIS 7.5(Windows 7)下的ASP.NET网站运行非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在台式机上安装了Windows 7 x64 Ultimate。我安装了IIS,Visual Studio 2008,注册了ASP.NET等。



我有这个ASP.NET 3.5网站,我正在这个新的IIS上运行极慢。在STA和PROD服务器(Windows 2003 Server)以及我的旧版XP / IIS 5.1上,一切都可以正常运行。



通常需要1-2秒的页面加载时间8秒!!!



我看到了这篇文章。它说的是关于Vista / 7的一些问题,而不是池化连接(只是要让您知道,该网站正在本地运行,但它正在连接到托管在远程服务器上的SQL Server 2005)。



似乎开始加载页面需要一段时间...我的意思是,我单击刷新,它停留了几秒钟等待本地主机 ...然后,当它得到响应时,它将正常加载整个页面...



我不知道如何强制Win7 / IIS7.5池化数据库连接。



编辑:我创建了一个新的空ASP.NET Web应用程序,以查看问题是否也发生了。答案是否定的,它会以空的默认页面快速响应。也许与数据库连接有关。我将做进一步的测试。

编辑2:调试应用程序我注意到执行时会发生延迟。 NET代码(Page_Load等)...因此,当IIS将页面提供给浏览器时,延迟似乎在某个地方。

解决方案

对于那些有相同问题的人,这是两个可能的解决方案。




  • 1)在Firefox中禁用IPv6支持(仅适用于Firefox)



我发现的大多数作者都建议这种方法是最快,最干净的解决方案。您需要做的基本上是在Firefox中打开配置设置(about:config),并将network.dns.disableIPv6设置更改为true。




  • 2)更改主机文件中的本地主机设置(所有浏览器)



这是我检查位置和方式的一种想法我可以干扰我机器上的IPv6设置吗?我看到上面提到的消息来源的评论之一说,可以通过简单地将localhost替换为url中的计算机名来解决该问题。



我很想检查一下,发现禁用IPv6本地主机查找与直接在Firefox中禁用IPv6一样。



您需要做的基本上是评论/删除此内容主机文件中的特定行:

 #:: 1 localhost 

注意::: 1表示法等同于IPv4 127.0.0.1查找地址的IPv6。



我相信第二种解决方案可能更适合一般不想禁用IPv6的用户,第一种解决方案是针对在日常工作中仍不使用IPv6的所有其他用户的解决方案。


I've just installed Windows 7 x64 Ultimate on my desktop PC. I installed IIS, Visual Studio 2008, registered ASP.NET, etc.

I have this ASP.NET 3.5 website I'm working on running EXTREMELY slow on this new IIS. On STA and PROD servers (Windows 2003 Server) and on my old XP/IIS 5.1 everything runs smoothly.

A page which usually takes 1-2 seconds to load is taking 8 seconds!!!

I saw this post on IIS forum. It says something about Vista/7 not pooling connections (just to let you know, the website is running locally but it's connecting to a SQL Server 2005 hosted on a remote server).

It seems that it takes a while to "start loading" the page... I mean, I click refresh and it stays for several seconds "Waiting for localhost"... Then when it gets response it loads the whole page normally...

I don't have a clue how to force Win7/IIS7.5 to pool database connections.

EDIT: I've created a new empty ASP.NET web application to see if the problems happens too. The answer is no, it responds fast as it should with an empty default page. Maybe is something related to the DB connection. I will do a further test. It should be a way to fix it...

EDIT 2: Debugging the app I noticed that the delay occurs AFTER the execution of .NET code (Page_Load, etc)... so the delay seems to be somewhere when IIS serves the page to the browser.

解决方案

For those having the same problem, here's two possible solution.

  • 1) Disabling IPv6 support in Firefox (only for Firefox)

Most of the authors that I found out about suggest this approach as quickest and cleanest solution. What you need to do is basically to open configuration settings in Firefox (about:config) and to change network.dns.disableIPv6 setting to true.

  • 2) Change localhost settings in your hosts file (all browsers)

This came to me as an idea to check where and how can I interfere in IPv6 settings on my machine. I saw one of the comments on above mentioned sources saying that one can get rid of the problem by simply replacing localhost with machine name in the url.

It didn’t take me long to check and see that disabling my IPv6 localhost lookup does the same thing as disabling IPv6 directly in Firefox.

What you need to do is basically to comment / delete this particular line in your hosts file:

#::1             localhost

Note: ::1 notation is IPv6 equivalent of the IPv4 127.0.0.1 lookup address.

I believe the second solution might be more suitable for users who do not want to disable IPv6 in general, and the first one for all others that still do not use IPv6 in their regular work.

这篇关于IIS 7.5(Windows 7)下的ASP.NET网站运行非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆