性能缓慢 - ASP .NET ASPNET_WP.EXE和CSC.EXE运行单击重定向链接后 [英] Slow Performance -- ASP .NET ASPNET_WP.EXE and CSC.EXE Running After Clicking Redirect Link

查看:342
本文介绍了性能缓慢 - ASP .NET ASPNET_WP.EXE和CSC.EXE运行单击重定向链接后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我点击从一个网页,做一个重定向到另一个页面的链接上(的Response.Redirect(page.aspx))。

I click on a link from one page that does a redirect to another page (Response.Redirect(page.aspx)).

浏览器搅动约30秒,页面显示。我试图追查为什么需要这么长的时间加载页面。

The browser churns for about 30 seconds and the page displays. I'm trying to track down why it takes so long to load the page.

该网页托管另外两个自定义控件。

The page hosts two other custom controls.

我注释掉code的每个线条和两个控件,而该网页还需要大约30秒加载。

I have commented out the lines of code for each and both controls, and the page still takes about 30 seconds to load.

我对每个控件的Page_Load事件中设置断点,以及page.aspx,它也需要大约30秒钟点击与Response.Redirect的链接第一个破发点。

I've set breakpoints on the Page_Load event for each of the controls as well as page.aspx and it also takes about 30 seconds from clicking the link with the Response.Redirect to the first break point.

我装了任务管理器,点击该链接。我注意到这个30秒的时间范围中ASPNET_WP.EXE和CSC.EXE运行。

I loaded up task manager and clicked on the link. I notice aspnet_wp.exe and csc.exe run during this 30 second time frame.

如果有某种code-背后shinanigans事情,而我等待页面加载的我不知道。

I'm wondering if there are some sort of code-behind shinanigans going on while I'm waiting for the page to load.

这仅发生在我第一次点击的链接。此后,它不是一样慢。

This only occurs the first time I click on the link. Afterwards, it's not as slow.

我GOOGLE了,但有没有很多关于这个有用的信息。任何人有什么想法?

I've googled but there's not a lot of useful information about this. Anyone have any ideas?

谢谢,

--- ---丹

推荐答案

在第一次的页面加载,那么asp.net编译很多的网页,几乎每个人都在同一个目录,包括模块发现,和bin中的DLL。

The very first time that the page is load, then the asp.net compile a lot of pages, almost every one found on the same dir, including modules, and dlls found on bin.

要加快(开发)尝试(仅适用于在开发计算机)上使用的web.config此选项。

To speed up (your development) try use this option on web.config (only on your development computer).

<compilation batch="false" ... >

使用批处理=false的asp.net编译只有一个网页,一个你就可以了,所以你得到一个大的时间在第一时间为dll文件,但在那之后,就少了很多,如果你有200页,你只改变一个,你开发/调试唯一的一个。

Using batch="false" asp.net compiles only one page, the one you are on it, so you get a big time the first time for the dlls, but after that, is a lot less if you have 200 pages, and you only change one, and you develop/debug only one.

另外,如果可以,尽量不要使用APP_ code目录,并将所有code一个dll里。
看更多关于web.config文件的编译选项,使其更运行速度更快,变化例如临时目录,以更快的不同的磁盘比C:

Also if you can, try do not use App_Code directory, and place all your code inside a dll. Look more about compilation options on web.config to make it even run faster, change for example the temporary directory to a faster different disk than the C:.

我会想多说一句把戏,我发现这里的计算器。

I will like to say one more trick that I found here on stackoverflow.

<compilation optimizeCompilations="true">

您只需要拥有一个安装补丁MS http://support.microsoft.com/kb/961884
我有测试,结果都非常好。

You only need to have install an ms patch http://support.microsoft.com/kb/961884 I have test it and the results are very good.

同样想到看台上,但你并不需要运行该补丁。

The same think stands, but you do not need to run the patch.

我注意到,对Web场第一次运行应用程序时,如果你有在应用程序启动Global.asax的许多工作,,然后我recoment使用互斥锁,并且只让一个池做的编译!网页否则有可能存在冲突和巨大的延时启动应用程序 - 特殊,如果您使用该程序的另一部分互斥

I have notice that on web farm the first time that application is run, if you have many work on global.asax on application start, then I recoment to use Mutex and let only one pool make the compile of the pages ! Or else there are possibilities for conflicts and huge delay to start the application - especial if you use mutex on other part of the program.

这篇关于性能缓慢 - ASP .NET ASPNET_WP.EXE和CSC.EXE运行单击重定向链接后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆