我的本地主机现在运行得很慢,因为我使用的是 Windows 7 和 Asp.net MVC
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1416128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
My Local Host goes so slow now that I am on windows 7 and Asp.net MVC
提问by chobo2
I switched from windows xp to windows 7 pro 64bit. When my computer was in xp I had 2 gigs of ram and overclocked my cpu to 3.0ghz now I have 4gigs of ram but had to lower my cpu to 2.8ghzs.
我从 windows xp 切换到 windows 7 pro 64 位。当我的电脑在 xp 中时,我有 2 gigs 的 ram 并将我的 cpu 超频到 3.0ghz 现在我有 4gigs 的 ram 但不得不将我的 cpu 降低到 2.8ghzs。
Ever since I been running windows 7 local host goes so slow when I run my asp.net mvc site. I don't understand why. It can take up to 20seconds to load up a page. With an average being 10.
自从我运行 Windows 7 本地主机以来,当我运行我的 asp.net mvc 站点时,本地主机变得如此缓慢。我不明白为什么。加载一个页面最多可能需要 20 秒。平均为 10。
The thing I really don't get is that when I use sloppy and put my speed at 256kb it runs alot faster then when I don't use sloppy and just use local host.
我真正不明白的是,当我使用 sloppy 并将我的速度设置为 256kb 时,它的运行速度比我不使用 sloppy 而只使用本地主机时要快得多。
My site use to be instant on local host what I figure it should almost be since it is local host. So I can't understand why putting it at a speed is somehow faster.
我的网站过去在本地主机上是即时的,我认为它几乎应该是,因为它是本地主机。所以我不明白为什么把它放在一个速度上会更快。
Is there some option I need to set? Or some IIS setting? I don't think I installed IIS yet since I just use the built in thing from visual stuidos 2008(cassa?)
我需要设置一些选项吗?或者一些IIS设置?我认为我还没有安装 IIS,因为我只是使用了 Visual stuidos 2008(cassa?)
I get the same slowness in all major browser(firefox,IE,chrome,opera,safari).
我在所有主要浏览器(firefox、IE、chrome、opera、safari)中的速度都一样慢。
Thanks
谢谢
回答by AASoft
I've had this problem many times, it started with Vista for me. It is due to IPv6. In your hosts file, comment out the definition for the IPv6 address for localhost, and things should go to normal speed. Also, I dont know if you actually need to or not, but I suggest flushing the DNS cache after doing this change, and restart your browser.
我遇到过很多次这个问题,它对我来说是从 Vista 开始的。这是由于 IPv6。在您的主机文件中,注释掉 localhost 的 IPv6 地址的定义,事情应该会恢复正常速度。另外,我不知道您是否真的需要,但我建议在进行此更改后刷新 DNS 缓存,然后重新启动浏览器。
回答by Guffa
One possible problem is IPv6. I know that at least Firefox has a problem with how it's implemented in Windows for localhost, so disabling it makes it as fast as it should be.
一个可能的问题是 IPv6。我知道至少 Firefox 在 Windows 中为 localhost 实现它的方式存在问题,因此禁用它可以使其尽可能快。
Browse to about:config
and change the network.dns.disableIPv6
key from false
to true
.
浏览到about:config
并将network.dns.disableIPv6
密钥从更改false
为true
。
However, this problem usually only adds a few seconds to the load time, so there might be something more afoot in your case.
但是,此问题通常只会使加载时间增加几秒钟,因此在您的情况下可能会发生更多事情。
回答by Earlz
I'm running Windows 7 and I fixed this by going into the hosts file and uncommentingthe 127.0.0.1/localhost entry. Apparently it was running to the DNS server and resolving localhost from there.
我正在运行 Windows 7,我通过进入主机文件并取消注释127.0.0.1/localhost 条目来解决此问题。显然它正在运行到 DNS 服务器并从那里解析本地主机。
回答by W.M.
You have to make sure that all entries for 127.0.0.1 are placed on the same line in the hostsfile. A configuration like this:
您必须确保 127.0.0.1 的所有条目都放在主机文件的同一行上。这样的配置:
127.0.0.1 localhost
127.0.0.1 mysite
should be changed to:
应改为:
127.0.0.1 localhost mysite
This small modification has increased the speed at my Windows based system incredibly.
这个小小的修改极大地提高了我基于 Windows 的系统的速度。
回答by Tom Anderson
I have noticed this even on Vista.
我什至在 Vista 上也注意到了这一点。
I simply use IE instead of Chrome/Firefox for quick and dirty programming checks.
我只是使用 IE 而不是 Chrome/Firefox 来进行快速而肮脏的编程检查。
The best solution would be to install IIS and not use the built in Cassini web server.
最好的解决方案是安装 IIS,而不是使用内置的 Cassini Web 服务器。