Slow Rendering Page on First Access

Discussion in 'ASP .Net' started by Wannabe, Mar 6, 2008.

  1. Wannabe

    Wannabe Guest

    I have a page that take 10-15 seconds to load up the first time you access
    it. Once the page loads, it runs super quick, but that initial hit (like
    after an hour if no one has hit the page) takes a long time to come up.

    Just to rule out databases, and any other external thing I could think of, I
    tried creating a website that had nothing but one page. On that page, I put a
    label that displayed the time when accessed. This page did exactly the same
    thing as above.

    Anyone got any suggestions on what I can try?
    Wannabe, Mar 6, 2008
    #1
    1. Advertising

  2. First time you hit your application your application is compiled and
    Application_Init runs..
    So depends on how big it is and how time consuming your Application_Init is
    the delay is expected.

    Also after some period of inactivity your application is unloaded. Hence if
    will be recompiled and Init run again next time you hit it.


    To speed things up you can do following....

    1. Precompiled it. (if you using .NET 2.0) Google it up how to do it.
    2. Disable unloading.... You need to have access to IIS management console
    and go into the Pools under "IIS" tree.. There will be an option there...


    George.



    "Wannabe" <> wrote in message
    news:...
    >I have a page that take 10-15 seconds to load up the first time you access
    > it. Once the page loads, it runs super quick, but that initial hit (like
    > after an hour if no one has hit the page) takes a long time to come up.
    >
    > Just to rule out databases, and any other external thing I could think of,
    > I
    > tried creating a website that had nothing but one page. On that page, I
    > put a
    > label that displayed the time when accessed. This page did exactly the
    > same
    > thing as above.
    >
    > Anyone got any suggestions on what I can try?
    >
    >
    George Ter-Saakov, Mar 6, 2008
    #2
    1. Advertising

  3. Wannabe

    Wannabe Guest

    Thanks for the advice, but I have one question...

    We have another server that our web apps do not do this, or it is not
    noticeable, and we have never precompiled or stopped our apps from unloading.
    Is there something else, or would you say that the servers are configured
    separately. They are both the same model, speed, memory, etc.

    Thanks

    "George Ter-Saakov" wrote:

    > First time you hit your application your application is compiled and
    > Application_Init runs..
    > So depends on how big it is and how time consuming your Application_Init is
    > the delay is expected.
    >
    > Also after some period of inactivity your application is unloaded. Hence if
    > will be recompiled and Init run again next time you hit it.
    >
    >
    > To speed things up you can do following....
    >
    > 1. Precompiled it. (if you using .NET 2.0) Google it up how to do it.
    > 2. Disable unloading.... You need to have access to IIS management console
    > and go into the Pools under "IIS" tree.. There will be an option there...
    >
    >
    > George.
    >
    >
    >
    > "Wannabe" <> wrote in message
    > news:...
    > >I have a page that take 10-15 seconds to load up the first time you access
    > > it. Once the page loads, it runs super quick, but that initial hit (like
    > > after an hour if no one has hit the page) takes a long time to come up.
    > >
    > > Just to rule out databases, and any other external thing I could think of,
    > > I
    > > tried creating a website that had nothing but one page. On that page, I
    > > put a
    > > label that displayed the time when accessed. This page did exactly the
    > > same
    > > thing as above.
    > >
    > > Anyone got any suggestions on what I can try?
    > >
    > >

    >
    >
    >
    Wannabe, Mar 6, 2008
    #3
  4. I would say, double check what you saying...
    It's easy to see that application is not precompiled. But it's not that easy
    to say that application is unloading or not.

    you have to go and check in IIS Management console .NET Pool settings. And
    since it's per pool and not application may be someone had set it for
    another application and your application is benefiting form it without you
    realizing it.

    ----------------Assuming you verified it and it's how you say it
    is-------------
    Something slows down your application on one machine and does not do it on
    second machine..

    My guess would be
    1. Antivirus....NET create temp DLLs and with antivirus present it might
    want to scan those DLLs before allowing them to be loaded into memory...

    2. Different web.config. your machines might have different web.config
    settings (debug is on for example) that would make a difference

    3. Slow machine vs Fast machine... Even if you have same CPU/memory you
    still might have some external processes that eat CPU time on one machine
    and does not exist on another machine. Antivirus again is one of the
    examples...

    George.




    "Wannabe" <> wrote in message
    news:...
    > Thanks for the advice, but I have one question...
    >
    > We have another server that our web apps do not do this, or it is not
    > noticeable, and we have never precompiled or stopped our apps from
    > unloading.
    > Is there something else, or would you say that the servers are configured
    > separately. They are both the same model, speed, memory, etc.
    >
    > Thanks
    >
    > "George Ter-Saakov" wrote:
    >
    >> First time you hit your application your application is compiled and
    >> Application_Init runs..
    >> So depends on how big it is and how time consuming your Application_Init
    >> is
    >> the delay is expected.
    >>
    >> Also after some period of inactivity your application is unloaded. Hence
    >> if
    >> will be recompiled and Init run again next time you hit it.
    >>
    >>
    >> To speed things up you can do following....
    >>
    >> 1. Precompiled it. (if you using .NET 2.0) Google it up how to do it.
    >> 2. Disable unloading.... You need to have access to IIS management
    >> console
    >> and go into the Pools under "IIS" tree.. There will be an option there...
    >>
    >>
    >> George.
    >>
    >>
    >>
    >> "Wannabe" <> wrote in message
    >> news:...
    >> >I have a page that take 10-15 seconds to load up the first time you
    >> >access
    >> > it. Once the page loads, it runs super quick, but that initial hit
    >> > (like
    >> > after an hour if no one has hit the page) takes a long time to come up.
    >> >
    >> > Just to rule out databases, and any other external thing I could think
    >> > of,
    >> > I
    >> > tried creating a website that had nothing but one page. On that page, I
    >> > put a
    >> > label that displayed the time when accessed. This page did exactly the
    >> > same
    >> > thing as above.
    >> >
    >> > Anyone got any suggestions on what I can try?
    >> >
    >> >

    >>
    >>
    >>
    George Ter-Saakov, Mar 6, 2008
    #4
    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. Chris
    Replies:
    0
    Views:
    544
    Chris
    Jul 15, 2003
  2. wardy
    Replies:
    6
    Views:
    7,073
    John Saunders
    Jun 18, 2004
  3. Marcus Leon

    Why is servlet slow on first access?

    Marcus Leon, May 24, 2005, in forum: Java
    Replies:
    2
    Views:
    908
    Wibble
    May 25, 2005
  4. Peter Mount
    Replies:
    4
    Views:
    921
    Peter Mount
    Jan 31, 2006
  5. Cirene
    Replies:
    4
    Views:
    292
    Peter Bromberg [C# MVP]
    Nov 22, 2007
Loading...

Share This Page