简体   繁体   中英

ASP.Net Performance

I am configuring an ASP.Net (VB.Net) application on my system. I have Visual Studio 2010 and also have compiled the code and deployed the compiled version on a server. On both places I get the response of the pages after so long (as long as more than a minute).

Strange thing:

I have put code to calculate the time it takes from entry to Page load handler to exit from Page close handler which is normal (less than a second). The application does not have any http modules, neither it has Global.asax nor the page has other overriden handlers.

Question1: If the time between page load and page close is so small why is it taking too long to respond? Question2: What techniques I can use to actually debug what is happening when it is awaited response?

Thanks in advance.

-----update--------- in response to krshekhar's question below I'm attaching screenshot of the page response I got from HttpWatch

在此处输入图片说明

What is the size of the page?
Use Mozilla Firefox.
Download firebug
Install add on why-slow yahoo add on.
And see the option available in the report.

You mention the "page close" handler - what is this? The page close event is a browser event, rather than a server one, so I am unclear as to how this is being fired.

From your trace, I am assuming that master.aspx is taking 270 seconds from client request being sent to render being completed for only 31000 bytes of information. Given that this is happening locally as well as when deployed to the server, this makes it likely that there is at least one section of code that is taking a significant amount of time to execute.

What I would recommend to start with is to add debug to your page load event to see how long this is taking to run. I'd simply do this with Debug.WriteLine("Point x reached at " & Now.ToString("yyyy-MM-dd hh:mm:ss.nnn) to start with to give you an idea at what time you are hitting each piece of code. From there you may see an obvious area that is taking a long time.

I wouldn't be at all surprised if you find that your data fetches are taking longer than expected - are you using multi-threaded data loading at all?

Try timing from the Page_PreInit event until the Page_Unload event. That should give you a more decent view. Also is the timing you posted for a normal LOAD, or a SUBMIT (or postback) event?

Plus, is your database connection being handled INSIDE your codes or outside (ie, would the timing be able to catch the time it takes to make the necessary network connection)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM