Find out how long a webcontrol / usercontrol takes for processing?

Discussion in 'ASP .Net' started by DC, May 26, 2008.

  1. DC

    DC Guest

    Hi,

    our cms (asp.net 2.0) dynamically inserts controls into asp.net pages,
    sometimes 50 and more per page, and if we run into a performance
    bottleneck we have a hard time finding out which controls cause
    latencies.

    We can find most of these bottlenecks by monitoring db traffic with
    profiler, but we are now using an increasing amount of third party
    controls which communicate with outside webservices.

    We cannot insert any code into these controls and delays may not
    depend of IO at all times. So my question is, can we inject something
    that will give us a good figure about the control expenses? Ideally,
    we would log the performance since we also see controls that usually
    perform OK but become stop blocks the other moment.

    TIA for any ideas,
    Regards
    DC
     
    DC, May 26, 2008
    #1
    1. Advertising

  2. Have a look at the time to last byte and time to first byte from the perf
    counters. That will tell you your render time. Experiment with fewer
    controls and you will be able to find the balance point before performance
    starts to tank. Perhaps a better option is to run WhySlow which is a plugin
    on firefox, it will tell you why your web site is dog slow.

    --

    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The O.W.C. Black Book, 2nd Edition
    Exclusively on www.lulu.com/owc $19.99
    -------------------------------------------------------


    "DC" <> wrote in message
    news:...
    > Hi,
    >
    > our cms (asp.net 2.0) dynamically inserts controls into asp.net pages,
    > sometimes 50 and more per page, and if we run into a performance
    > bottleneck we have a hard time finding out which controls cause
    > latencies.
    >
    > We can find most of these bottlenecks by monitoring db traffic with
    > profiler, but we are now using an increasing amount of third party
    > controls which communicate with outside webservices.
    >
    > We cannot insert any code into these controls and delays may not
    > depend of IO at all times. So my question is, can we inject something
    > that will give us a good figure about the control expenses? Ideally,
    > we would log the performance since we also see controls that usually
    > perform OK but become stop blocks the other moment.
    >
    > TIA for any ideas,
    > Regards
    > DC
     
    Alvin Bruney [ASP.NET MVP], May 28, 2008
    #2
    1. Advertising

  3. DC

    DC Guest

    Re: Find out how long a webcontrol / usercontrol takes forprocessing?

    On 28 Mai, 04:32, "Alvin Bruney [ASP.NET MVP]" <vapor dan using hot
    male spam filter> wrote:
    > Have a look at the time to last byte and time to first byte from the perf
    > counters. That will tell you your render time. Experiment with fewer
    > controls and you will be able to find the balance point before performance
    > starts to tank. Perhaps a better option is to run WhySlow which is a plugin
    > on firefox, it will tell you why your web site is dog slow.
    >
    > --
    >
    > Regards,
    > Alvin Bruney [MVP ASP.NET]
    >
    > [Shameless Author plug]
    > The O.W.C. Black Book, 2nd Edition
    > Exclusively onwww.lulu.com/owc$19.99
    > -------------------------------------------------------
    >
    > "DC" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi,

    >
    > > our cms (asp.net 2.0) dynamically inserts controls into asp.net pages,
    > > sometimes 50 and more per page, and if we run into a performance
    > > bottleneck we have a hard time finding out which controls cause
    > > latencies.

    >
    > > We can find most of these bottlenecks by monitoring db traffic with
    > > profiler, but we are now using an increasing amount of third party
    > > controls which communicate with outside webservices.

    >
    > > We cannot insert any code into these controls and delays may not
    > > depend of IO at all times. So my question is, can we inject something
    > > that will give us a good figure about the control expenses? Ideally,
    > > we would log the performance since we also see controls that usually
    > > perform OK but become stop blocks the other moment.

    >
    > > TIA for any ideas,
    > > Regards
    > > DC- Zitierten Text ausblenden -

    >
    > - Zitierten Text anzeigen -


    Thank you, Alvin. We do already measure ttlb and sql performance data,
    but we have to log performance on control level. We can find out which
    control is causing which latency by intermittently disabling one or
    the other control as you have suggested, but what I am looking for is
    ongoing performance monitoring, because some of the controls with
    external data connections do only cause delays at some times, and we
    need to monitor this for our service levels.

    Regards
    DC
     
    DC, May 28, 2008
    #3
  4. On Mon, 26 May 2008 02:09:56 -0700 (PDT), DC <> wrote:

    >Hi,
    >
    >our cms (asp.net 2.0) dynamically inserts controls into asp.net pages,
    >sometimes 50 and more per page, and if we run into a performance
    >bottleneck we have a hard time finding out which controls cause
    >latencies.
    >

    Fifty seems like a large number of top level controls.
    >We can find most of these bottlenecks by monitoring db traffic with
    >profiler, but we are now using an increasing amount of third party
    >controls which communicate with outside webservices.
    >
    >We cannot insert any code into these controls and delays may not
    >depend of IO at all times. So my question is, can we inject something
    >that will give us a good figure about the control expenses? Ideally,
    >we would log the performance since we also see controls that usually
    >perform OK but become stop blocks the other moment.
    >

    The varying behavior of how quickly the controls' load tell me the
    controls are only displaying symptoms of issues removed from the
    application itself. The web service or database server are likely
    where the performance issues are when a control is slow to load. The
    controls are at the mercy of their external data sources.

    If the problem is appearing preparing a single page instance it may
    get worse. The external sources the controls require may become
    swamped when tens, hundreds or thousands of page instances are created
    in rapid succession.

    I can only question the need for all the controls and their associated
    synchronous thrash on a single page. Do the people "designing" the
    page with the CMS app know anything about how ASP.NET web applications
    and controls work?

    regards
    A.G.
     
    Registered User, May 28, 2008
    #4
  5. You could probably experiment with a static method in Global.asax that uses
    the Stopwatch class to handle timings and log the results either to a file
    or a database. You could set up parameters such as page name, control name,
    etc.
    You'd invoke the method that starts the stopwatch just before loading each
    control and stop it just after, which method would perform the logging.
    Peter

    "DC" <> wrote in message
    news:...
    > On 28 Mai, 04:32, "Alvin Bruney [ASP.NET MVP]" <vapor dan using hot
    > male spam filter> wrote:
    >> Have a look at the time to last byte and time to first byte from the perf
    >> counters. That will tell you your render time. Experiment with fewer
    >> controls and you will be able to find the balance point before
    >> performance
    >> starts to tank. Perhaps a better option is to run WhySlow which is a
    >> plugin
    >> on firefox, it will tell you why your web site is dog slow.
    >>
    >> --
    >>
    >> Regards,
    >> Alvin Bruney [MVP ASP.NET]
    >>
    >> [Shameless Author plug]
    >> The O.W.C. Black Book, 2nd Edition
    >> Exclusively onwww.lulu.com/owc$19.99
    >> -------------------------------------------------------
    >>
    >> "DC" <> wrote in message
    >>
    >> news:...
    >>
    >>
    >>
    >> > Hi,

    >>
    >> > our cms (asp.net 2.0) dynamically inserts controls into asp.net pages,
    >> > sometimes 50 and more per page, and if we run into a performance
    >> > bottleneck we have a hard time finding out which controls cause
    >> > latencies.

    >>
    >> > We can find most of these bottlenecks by monitoring db traffic with
    >> > profiler, but we are now using an increasing amount of third party
    >> > controls which communicate with outside webservices.

    >>
    >> > We cannot insert any code into these controls and delays may not
    >> > depend of IO at all times. So my question is, can we inject something
    >> > that will give us a good figure about the control expenses? Ideally,
    >> > we would log the performance since we also see controls that usually
    >> > perform OK but become stop blocks the other moment.

    >>
    >> > TIA for any ideas,
    >> > Regards
    >> > DC- Zitierten Text ausblenden -

    >>
    >> - Zitierten Text anzeigen -

    >
    > Thank you, Alvin. We do already measure ttlb and sql performance data,
    > but we have to log performance on control level. We can find out which
    > control is causing which latency by intermittently disabling one or
    > the other control as you have suggested, but what I am looking for is
    > ongoing performance monitoring, because some of the controls with
    > external data connections do only cause delays at some times, and we
    > need to monitor this for our service levels.
    >
    > Regards
    > DC
     
    Peter Bromberg [C# MVP], May 29, 2008
    #5
  6. DC

    DC Guest

    Re: Find out how long a webcontrol / usercontrol takes forprocessing?

    On 29 Mai, 02:27, "Peter Bromberg [C# MVP]"
    <> wrote:
    > You could probably experiment with a static method in Global.asax that uses
    > the Stopwatch class to handle timings and log the results either to a file
    > or a database. You could set up parameters such as page name, control name,
    > etc.
    > You'd invoke the method that starts the stopwatch just before loading each
    > control and stop it just after, which method would perform the logging.
    > Peter
    >
    > "DC" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On 28 Mai, 04:32, "Alvin Bruney [ASP.NET MVP]" <vapor dan using hot
    > > male spam filter> wrote:
    > >> Have a look at the time to last byte and time to first byte from the perf
    > >> counters. That will tell you your render time. Experiment with fewer
    > >> controls and you will be able to find the balance point before
    > >> performance
    > >> starts to tank. Perhaps a better option is to run WhySlow which is a
    > >> plugin
    > >> on firefox, it will tell you why your web site is dog slow.

    >
    > >> --

    >
    > >> Regards,
    > >> Alvin Bruney [MVP ASP.NET]

    >
    > >> [Shameless Author plug]
    > >> The O.W.C. Black Book, 2nd Edition
    > >> Exclusively onwww.lulu.com/owc$19.99
    > >> -------------------------------------------------------

    >
    > >> "DC" <> wrote in message

    >
    > >>news:...

    >
    > >> > Hi,

    >
    > >> > our cms (asp.net 2.0) dynamically inserts controls into asp.net pages,
    > >> > sometimes 50 and more per page, and if we run into a performance
    > >> > bottleneck we have a hard time finding out which controls cause
    > >> > latencies.

    >
    > >> > We can find most of these bottlenecks by monitoring db traffic with
    > >> > profiler, but we are now using an increasing amount of third party
    > >> > controls which communicate with outside webservices.

    >
    > >> > We cannot insert any code into these controls and delays may not
    > >> > depend of IO at all times. So my question is, can we inject something
    > >> > that will give us a good figure about the control expenses? Ideally,
    > >> > we would log the performance since we also see controls that usually
    > >> > perform OK but become stop blocks the other moment.

    >
    > >> > TIA for any ideas,
    > >> > Regards
    > >> > DC- Zitierten Text ausblenden -

    >
    > >> - Zitierten Text anzeigen -

    >
    > > Thank you, Alvin. We do already measure ttlb and sql performance data,
    > > but we have to log performance on control level. We can find out which
    > > control is causing which latency by intermittently disabling one or
    > > the other control as you have suggested, but what I am looking for is
    > > ongoing performance monitoring, because some of the controls with
    > > external data connections do only cause delays at some times, and we
    > > need to monitor this for our service levels.

    >
    > > Regards
    > > DC- Zitierten Text ausblenden -

    >
    > - Zitierten Text anzeigen -


    First of all thank you for mentioning the Stopwatch class, Peter -
    because I did not know it and I always make up my own little helpers
    for that.

    About the global.asax: I thought there were no events before and after
    control rendering, I guess we would have to log different parts of the
    control lifecycle, like logging how long the Init takes, how long Load
    takes (we don't know where the control designers load their data). But
    this motivates me to take a closer look at global asax and trace
    facilities, maybe I can get the required granularity.

    Regards
    DC
     
    DC, May 30, 2008
    #6
  7. DC

    DC Guest

    Re: Find out how long a webcontrol / usercontrol takes forprocessing?

    On 28 Mai, 21:15, Registered User <> wrote:
    > On Mon, 26 May 2008 02:09:56 -0700 (PDT), DC <> wrote:
    > >Hi,

    >
    > >our cms (asp.net 2.0) dynamically inserts controls into asp.net pages,
    > >sometimes 50 and more per page, and if we run into a performance
    > >bottleneck we have a hard time finding out which controls cause
    > >latencies.

    >
    > Fifty seems like a large number of top level controls.>We can find most of these bottlenecks by monitoring db traffic with
    > >profiler, but we are now using an increasing amount of third party
    > >controls which communicate with outside webservices.

    >
    > >We cannot insert any code into these controls and delays may not
    > >depend of IO at all times. So my question is, can we inject something
    > >that will give us a good figure about the control expenses? Ideally,
    > >we would log the performance since we also see controls that usually
    > >perform OK but become stop blocks the other moment.

    >
    > The varying behavior of how quickly the controls' load tell me the
    > controls are only displaying symptoms of issues removed from the
    > application itself. The web service or database server are likely
    > where the performance issues are when a control is slow to load. The
    > controls are at the mercy of their external data sources.
    >
    > If the problem is appearing preparing a single page instance it may
    > get worse. The external sources the controls require may become
    > swamped when tens, hundreds or thousands of page instances are created
    > in rapid succession.
    >
    > I can only question the need for all the controls and their associated
    > synchronous thrash on a single page. Do the people "designing" the
    > page with the CMS app know anything about how ASP.NET web applications
    > and controls work?
    >
    > regards
    > A.G.


    Thank you, A.G. Your considerations about external I/O and page
    production times are exaclty what we run into at times, and we want to
    monitor that on a control level if possible (since different controls
    on our site are designed by different contractors and we have to nail
    down who is responsible for which delay).

    In my opinion 50 top level controls is a medium amount, considering
    that a LinkButton is a control. Actually our cms usually uses small
    (and fast to produce) content controls for most of the part and only a
    few more sophisticated controls (i. e. tools). But a number a 50
    controls easily accumulates on a portal side (where the non-techs
    require that there is enough content on one page to fill up 10
    vertical screens - no matter how useless that is).

    Regards
    DC
     
    DC, May 30, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. huobazi
    Replies:
    1
    Views:
    739
    David Waz...
    Jul 3, 2003
  2. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    746
    Eric Sosman
    Jul 8, 2003
  3. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,244
    Peter Shaggy Haywood
    Sep 20, 2005
  4. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    515
    santosh
    Jul 24, 2007
  5. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    852
    Peter Nilsson
    Jan 15, 2008
Loading...

Share This Page