Finding Bottlenecks

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hi there,

I have a website that functions fine locally, but when published to the
server it develops a bottleneck during loading some of the pages. Basically
what happens is the page loads to about 25% then it freezes for anything
from 10 - 40 seconds, before suddenly loading the rest of the page.

Of course I understand that this could be down to some code on the page
locking the thread or suchlike, but I would like to be able to be able to
find exactly where the bottle neck is occuring. Strangely enough this
doesn't seem to occur in Firefox although Firefox displays quicker it seems
to do whatever is holding IE up in the background so you get the illusion of
it loading quicker.

Any suggestions on tools or methods for finding bottlenecks in page
loading? Many thanks in advance for your time and help.

Nick.
 
Tracing works, if you want something easy to turn on and a bit down and
dirty. You can also code a trace listener if you want to log these things.

There are also tools that you can profile your code with, although most of
them cost at least something. If you have a Team System SKU, there is a
profile included. Not quite what some of the Enterprise tools out there
offer, but a good start. DotTrace, from JetBrains, is a nice personal
profiler (at $199 for personal, not bad pricing either).

I will have to find the link, but I saw a neat free profiler for the Compact
Framework, which I think will work with non CE programs. Note to self: have
to find the link. :-)

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

********************************************
| Think outside the box! |
********************************************
 
Hi Nick,

Regarding on such issue, for locating the bottle neck, it is quite common
to do some tracing or profiling work upon your web application. for tracing
, the ASP.NET has already provided trace functionality:

#ASP.NET Trace
http://msdn.microsoft.com/en-us/library/y13fw6we(VS.71).aspx

#Tracing in ASP.NET 2.0
http://www.beansoftware.com/ASP.NET-Tutorials/Tracing-ASP.NET.aspx

You can add trace print statement in those page events/functions where you
put code logic(may block the page) so that in the trace output, you can
view the time point those event arrive and the next one starts.

Also, visual studio has provided good profiling tools that can help track
the performance issues:

#Analyzing Application Performance using Profiling Tools
http://msdn.microsoft.com/en-us/library/z9z62c29.aspx

#How to: Create Performance Session for ASP.NET Applications
http://msdn.microsoft.com/en-us/library/2s0xxa1d(VS.80).aspx

the profiling report can give you some info such as what are the most used
functions, or the most long run functions...

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.






--------------------
 
Hi Gregory,

Thanks a million for the information I think I'll give tracing a go and
see if that shows anything before having a look at the profiling systems.

Cheers for your time.

Nick.
 
Hi Steven,

Thanks for your help and links to articles, they are most helpful.

Unfortunately I enabled tracing and when I finally got it to work during
the bottleneck it didn't show the results I was expecting. It said that end
render fired 0.96 seconds after the first event, that's far from the truth
as it took roughly 15 seconds for all images to appear and for the progress
bar to complete.

I guess that means that I'm going to have to look at profiling as per
Gregs suggestion.

Thanks for your time in the matter.

Nick.
 
Hi Patrice,

I think you are right, I have run profiling on the effected part and cut
down as much loading time as I possible could which has shaved a couple of
seconds off the loading time, but the delay is still there.

I'm not quite sure if it would be classed as a complex section though
tbh, I mean it's styled DIV with an unordered list UL inside which get
styled into buttons through the containing DIVs style. So pretty basic
really, but what currently happens is it gets to like the 2nd or 3rd button
then pauses for x seconds before resuming with page rendering.

Although with that said, one of the items does contain a few variables,
i.e. <%$AppSettings:blabla %>, so I'm not sure if that could be slowing
things down as it's on the 4th button. I'll see what changing it does...

Thanks for your time and feedback, I'll get to the bottom of this
eventually.

Nick.

Patrice said:
It could be just that this is a client side issue (I thought about that
also when seeing that you said it was quicker with FF).

Of course with ASP.NET trace enabled you are just seeing server side
processing. My guess would be that you could have a quite complex nested
structure for your page that takes a fair amount of time to layout in
IE...

--
Patrice

Nick said:
Hi Steven,

Thanks for your help and links to articles, they are most helpful.

Unfortunately I enabled tracing and when I finally got it to work
during the bottleneck it didn't show the results I was expecting. It
said that end render fired 0.96 seconds after the first event, that's far
from the truth as it took roughly 15 seconds for all images to appear and
for the progress bar to complete.

I guess that means that I'm going to have to look at profiling as per
Gregs suggestion.

Thanks for your time in the matter.

Nick.

[cut]>
 
Thanks for the reply Nick,

yes, as you've profiled, the server-side processing takes much less time
than what you actually seen(from the first event to the page display at
client). Then, the problem is likely occuring during the output
rendering/transfering from server to the client browser. Generally, you
can first check page size to make sure it is reasonable and not too
large(such as contains large viewstate). Then, we need to take further look
into the behavior, maybe some network trace will be also necessary.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
<[email protected]>
Subject: Re: Finding Bottlenecks
Date: Wed, 23 Jul 2008 14:07:06 +0100
Hi Patrice,

I think you are right, I have run profiling on the effected part and cut
down as much loading time as I possible could which has shaved a couple of
seconds off the loading time, but the delay is still there.

I'm not quite sure if it would be classed as a complex section though
tbh, I mean it's styled DIV with an unordered list UL inside which get
styled into buttons through the containing DIVs style. So pretty basic
really, but what currently happens is it gets to like the 2nd or 3rd button
then pauses for x seconds before resuming with page rendering.

Although with that said, one of the items does contain a few variables,
i.e. <%$AppSettings:blabla %>, so I'm not sure if that could be slowing
things down as it's on the 4th button. I'll see what changing it does...

Thanks for your time and feedback, I'll get to the bottom of this
eventually.

Nick.

Patrice said:
It could be just that this is a client side issue (I thought about that
also when seeing that you said it was quicker with FF).

Of course with ASP.NET trace enabled you are just seeing server side
processing. My guess would be that you could have a quite complex nested
structure for your page that takes a fair amount of time to layout in
IE...

--
Patrice

Nick said:
Hi Steven,

Thanks for your help and links to articles, they are most helpful.

Unfortunately I enabled tracing and when I finally got it to work
during the bottleneck it didn't show the results I was expecting. It
said that end render fired 0.96 seconds after the first event, that's far
from the truth as it took roughly 15 seconds for all images to appear and
for the progress bar to complete.

I guess that means that I'm going to have to look at profiling as per
Gregs suggestion.

Thanks for your time in the matter.

Nick.

[cut]>
 
Back
Top