[英]MVC 5 application on IIS 8 in Windows Server 2012 (virtual machine) is very slow (not only on initial load)
The goal is to launch an MVC 5 web app on an IIS 8 within a Windows Server 2012 (Standard edition for evaluation from Microsoft) in a virtual machine (VMware Workstation 12 Player, free version) in order to test the whole system for the release. 目标是在虚拟机 (VMware Workstation 12 Player,免费版)中的Windows Server 2012 (Microsoft评估标准版)中的IIS 8上启动MVC 5 Web应用程序,以测试整个系统的发行版。
I managed to run the application, but the problem is, that it´s extremely slow. 我设法运行了该应用程序,但问题是它的运行速度非常慢。 Eg the index.html is a static HTML page and needs more than 60 seconds to load.
例如,index.html是静态HTML页面,需要60秒钟以上的时间来加载。 But why?
但为什么? In Visual Studio and IIS Express still everything works perfectly.
在Visual Studio和IIS Express中,一切仍然可以正常运行。
Futher information: 更多信息:
C:\\inetpub\\wwwroot\\test"
. C:\\inetpub\\wwwroot\\test"
。 The target framework is .NET 4.6 . 目标框架是.NET 4.6 。 Therefore I´ve installed the .NET 4.6 package .
因此,我已经安装了.NET 4.6软件包 。 The DefaultAppPool says v4.0, but apparently uses the correct 4.6 version.
DefaultAppPool表示v4.0,但显然使用了正确的4.6版本。
For testing I´ve added another application to the same application pool - ie C:\\inetpub\\wwwroot\\test2"
- where I put a hello-world index.html. It loads fast. Therefore I expect a problem with MVC5 . 为了进行测试,我在同一应用程序池中添加了另一个应用程序-即
C:\\inetpub\\wwwroot\\test2"
-在其中放置了hello-world index.html。它加载速度很快。因此,我希望MVC5出现问题 。
The Windows Server 2012 is running in a virtual machine. Windows Server 2012在虚拟机中运行。 I gave the VM 4GB RAM and 6 CPU Cores (hyperthreaded), but it didn´t help.
我为VM提供了4GB RAM和6个CPU内核(超线程),但这并没有帮助。 The task manager shows a 5% CPU and 25% RAM consumption .
任务管理器显示5%的CPU和25%的RAM消耗 。 Therefore I assume that the problem lies in the IIS .
因此,我认为问题出在IIS上 。
I really appreciate your help! 非常感谢您的帮助!
Thanks, I have finally found the problem: I use the Sql Server LocalDb , which is a local .mdf-file in the filesystem. 谢谢,我终于找到了问题:我使用Sql Server LocalDb ,它是文件系统中的本地.mdf文件。 The Application Pool´s Identity was set to ApplicationPoolIdentity and I had to change it to LocalSystem .
应用程序池的标识设置为ApplicationPoolIdentity ,我不得不将其更改为LocalSystem 。 Now the application pool can access the database and the IIS runs as it should.
现在,应用程序池可以访问数据库,并且IIS可以正常运行。
What surprised me is, that even though the IIS didn´t need the database to load the index.html, it apparently tried to establish a connection right away. 令我惊讶的是,即使IIS 不需要数据库来加载index.html,它显然也试图立即建立连接。 After unsuccessful 60s it said, "Well I couldn´t connect, so I will try it without the database."
失败60 秒钟后,它说: “好吧,我无法连接,所以我将在没有数据库的情况下进行尝试。” and continued loading.
并继续加载。 In case the database was not needed, it worked.
万一不需要数据库,它就可以工作。 I guess that happens due to the DB-Connection-Pooling.
我猜这是由于DB-Connection-Pooling而发生的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.