ASP.NET MVC 3中的大量延迟

时间:2012-07-13 22:08:22

标签: asp.net asp.net-mvc

在一个页面上,我看到一些AJAX请求有500毫秒的延迟,我无法解释。有问题的页面会在加载时向同一个操作发出两个AJAX请求,其中一个将被阻止。那是为什么?

在调用Application_AcquireRequestState方法之前,ASP.NET堆栈有什么作用?我使用了MiniProfiler的贫民窟分析方法,当调用Application_AcquireRequestState时,我可以看到在对这两个Application_PostMapRequestHandlerApplication_AcquireRequestState的调用之间花费了很长时间。

我完全禁用了会话状态。

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Appfail.WebForms" version="1.1.0" targetFramework="net45" />
  <package id="AttributeRouting" version="2.5.1.0" targetFramework="net45" />
  <package id="AttributeRouting.Core" version="2.5.1.0" targetFramework="net45" />
  <package id="AttributeRouting.Core.Web" version="2.5.1.0" targetFramework="net45" />
  <package id="AutoMapper" version="2.1.267" />
  <package id="CodeContracts.Unofficial" version="1.0.0.2" targetFramework="net45" />
  <package id="DataAnnotationsExtensions" version="1.1.0.0" />
  <package id="DataAnnotationsExtensions.MVC3" version="1.1.0.0" />
  <package id="DiffPlex" version="1.2.0" targetFramework="net45" />
  <package id="DotNetOpenAuth.Core" version="4.1.0.12182" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Consumer" version="4.1.0.12182" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Core" version="4.1.0.12182" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth2.Client" version="0.25.0-draft1" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth2.ClientAuthorization" version="0.25.0-draft1" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth2.Core" version="0.25.0-draft1" targetFramework="net45" />
  <package id="DotNetOpenAuth.OpenId.Core" version="4.1.0.12182" targetFramework="net45" />
  <package id="DotNetOpenAuth.OpenId.RelyingParty" version="4.1.0.12182" targetFramework="net45" />
  <package id="DynamicQuery" version="1.0" />
  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
  <package id="LinqKit" version="1.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
  <package id="MiniProfiler" version="2.0.2" />
  <package id="MiniProfiler.EF" version="2.0.3" />
  <package id="morelinq" version="1.0" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="4.5.8" targetFramework="net45" />
  <package id="RequestReduce" version="1.8.76" targetFramework="net45" />
  <package id="WebActivator" version="1.5.1" />
  <package id="WebGrease" version="1.1.0" targetFramework="net45" />
</packages>

1 个答案:

答案 0 :(得分:0)

也许无关,因为我在Global.asax Application_Start()方法中做了很多初始化,所以我遇到了同样的问题。一旦我最小化它们,我的第一次冷负荷变得比以前快得多。