简体   繁体   English

从同一IIS上托管的另一个Web应用程序调用Web应用程序是否有延迟?

[英]Calling a web application from another web application hosted on the same IIS have latency?

I have two web applications built on 2.0 and 4.0 frameworks. 我有两个基于2.0和4.0框架构建的Web应用程序。 And i have link to 2.0 FW site from 4.0 FM site. 我已经从4.0 FM站点链接到2.0 FW站点。 So both are hosted on same IIS, but with different application pools. 因此,两者都托管在同一IIS上,但具有不同的应用程序池。 I am calling this site2.0 from site4.0 using iframe. 我正在使用iframe从site4.0调用此site2.0。 So when i click a button to load this site2.0, it is taking so much time to load for the first time. 因此,当我单击一个按钮来加载此site2.0时,第一次加载会花费很多时间。 Afterwards it loads as usual. 之后,它照常加载。 Please suggest me if you have suggestions. 如果您有建议,请提出建议。 I was thinking to use global.asax file and use Application_start event to load this site for the first time of site4.0 loads. 我当时正在考虑使用global.asax文件并使用Application_start事件来首次加载site4.0时加载此站点。 But not sure how to do it. 但是不确定如何做。

Thanks 谢谢

There are a few reasons to have latency on your requests: 延迟请求的原因有几个:

If it's the first request, your site is merely JITing (known as Just In Time Compilation). 如果是第一个请求,则您的站点仅仅是JITing(称为即时编译)。 This happens for the first invocation for any .NET application; 对于任何 .NET应用程序,第一次调用都会发生这种情况。 running on IIS it manifests itself as a longer than normal first request. 在IIS上运行时,它显示为比正常的第一个请求更长的时间。 This is normal. 这很正常。

There are two ways to combat it: 有两种解决方法:

  • "Pre Warm" your site by initiating a request right after deploy to cause the JITing (and view compilation) to occur. 通过在部署后立即发起请求以进行JITing(并查看编译)来“预热”您的站点。
  • Use a product like ngen to pre-JIT your site . 使用ngen类的产品来预先对您的网站进行JIT

If you have latency on subsequent requests, then you need to profile your application. 如果后续请求有延迟,则需要分析应用程序。 Ensure that it is built in 'Release' mode. 确保它以“发布”模式构建。

When the app pool is recycled, your site will have to re-JIT; 回收应用程序池后,您的站点将不得不重新进行JIT; this is normal . 这很正常 A keep alive task - an automated HTTP request utility (like a script that does a wget every so often) will keep your App Pool from recycling due to inactivity. 保持活动状态-自动化的HTTP请求实用程序(例如经常执行wget的脚本)将防止您的应用程序池因不活动而被回收。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 访问IIS上托管的Web应用程序 - Accessing web application hosted on IIS 从iis上托管的Web应用程序读取/写入共享驱动器中的文件 - Read/write files in shared drive from web application hosted on iis 从Linux Web应用程序中使用IIS托管的WCF服务 - Consuming IIS-hosted WCF Service from Linux Web Application 从IIS上托管的Web API打开WPF应用程序 - Open a WPF Application from Web API that is hosted on IIS Web应用程序中的线程使托管在IIS 7上的会话超时 - threading in web application giving a session timed out when hosted on iis 7 从IIS托管的应用程序通过SSL访问Web服务时出错 - Error accessing web service through SSL from IIS-hosted application 尝试从IIS中托管的Web应用程序连接到具有命名管道端点的WCF服务时,没有端点侦听错误 - No endpoint listening error when trying to connect to a WCF service with named pipe endpoint from Web application hosted in IIS 托管在另一台计算机上的Web应用程序可以在不将数据发送到服务器的情况下从本地.NET应用程序接收数据吗? - Can a web application hosted on another machine receive data from a local .NET application without sending data to the server? “ Web未在IIS中标记为应用程序” - “The Web is not marked as an application in IIS” 从IIS上的Web应用程序获取ServerContext - Get ServerContext from web application on IIS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM