[英]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: 有两种解决方法:
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.