It takes around 30~60 seconds to load a aspx site for the first time.Why?

Discussion in 'ASP .Net' started by Shige, Jan 5, 2004.

  1. Shige

    Shige Guest

    I have a .Net website hosted on another IIS6.0. Whenever I tried to
    access my website after a long time, it will take forever to load, my
    browser will just show a blank white page and the progress bar is
    loading so slow. However after it is loaded, the subsequent pages is
    loaded up almost instantly. And even after i close my IE and reopen
    again and load up the website again, it is still instantly loaded up.

    Somehow the problem only appear after the website is not access for a
    long period. How can i solve this problem? My IIS server is always on.

    Thanks.
     
    Shige, Jan 5, 2004
    #1
    1. Advertising

  2. Shige

    Hermit Dave Guest

    Re: It takes around 30~60 seconds to load a aspx site for the first time. Why?

    Okay.

    A page is not a page any more in the sense of what it used to be in classic
    ASP
    Its a class and you instantiate an object of it when you make a request.

    The way ASP.NET works is that if there is no compiled copy of the code....
    the first request would essentially JIT compile the bits of assembly that
    are needed.
    The part that is JIT compiled depends on what run time feels you are going
    to be using. That is the reason y after the first run you app runs like a
    treat.
    If however you do not use your app for a long time... the JIT'd version is
    discarded and the next request causes JIT on your assembly to create a
    native copy again.
    If you do not change you code over and over, then you might want to give
    ngen.exe a try.
    NGen essentially does a full native compilation of your assembly and every
    time a call is made to the assembly a check is made to see if there is an
    existing compiled version. If you have NGen'd your assembly that would
    always hold true.

    But also keep in mind that native compiled assemblies are heavier.

    --
    Regards,

    HD

    "Shige" <> wrote in message
    news:3ff8f6be$...
    > I have a .Net website hosted on another IIS6.0. Whenever I tried to
    > access my website after a long time, it will take forever to load, my
    > browser will just show a blank white page and the progress bar is
    > loading so slow. However after it is loaded, the subsequent pages is
    > loaded up almost instantly. And even after i close my IE and reopen
    > again and load up the website again, it is still instantly loaded up.
    >
    > Somehow the problem only appear after the website is not access for a
    > long period. How can i solve this problem? My IIS server is always on.
    >
    > Thanks.
    >
     
    Hermit Dave, Jan 5, 2004
    #2
    1. Advertising

  3. Shige

    Alvin Bruney Guest

    Re: It takes around 30~60 seconds to load a aspx site for the first time. Why?

    >If you do not change you code over and over, then you might want to give
    >ngen.exe a try.


    ngen is mostly a bad idea outside of a web app but frequently a very, very
    bad idea within the confines of the an asp.net application.

    Here is why:
    NGEN cannot make any assumptions for optimization for the run-time
    environment than that of the JIT because the JIT is actually running in the
    context of the execution environment. That alone causes NGEN to produce
    sub-optimized code, if not inefficient.

    Secondly, strongly named assemblies derive absolutely no benefit from NGEN
    since NGEN makes an assumption on domain neutrality only for mscorlib.
    Strongly named assemblies are always loaded domain neutral so the NGEN'd
    file is never used to begin with.

    I'd recommend instead that the startup code be streamlined to run lean and
    mean reducing start up times. For instance, I sincerely doubt that JIT'ing
    is responsible for this delay solely. Maybe the application is attempting to
    acquire resources or initializing structures which may be contributing
    heavily to this delay. Without inspecting the start up times, it is unfair
    to blame it on the JIT.

    --
    Regards,
    Alvin Bruney
    Got tidbits? Get it here...
    http://tinyurl.com/2bz4t
    "Hermit Dave" <> wrote in message
    news:%...
    > Okay.
    >
    > A page is not a page any more in the sense of what it used to be in

    classic
    > ASP
    > Its a class and you instantiate an object of it when you make a request.
    >
    > The way ASP.NET works is that if there is no compiled copy of the code....
    > the first request would essentially JIT compile the bits of assembly that
    > are needed.
    > The part that is JIT compiled depends on what run time feels you are going
    > to be using. That is the reason y after the first run you app runs like a
    > treat.
    > If however you do not use your app for a long time... the JIT'd version is
    > discarded and the next request causes JIT on your assembly to create a
    > native copy again.
    > If you do not change you code over and over, then you might want to give
    > ngen.exe a try.
    > NGen essentially does a full native compilation of your assembly and every
    > time a call is made to the assembly a check is made to see if there is an
    > existing compiled version. If you have NGen'd your assembly that would
    > always hold true.
    >
    > But also keep in mind that native compiled assemblies are heavier.
    >
    > --
    > Regards,
    >
    > HD
    >
    > "Shige" <> wrote in message
    > news:3ff8f6be$...
    > > I have a .Net website hosted on another IIS6.0. Whenever I tried to
    > > access my website after a long time, it will take forever to load, my
    > > browser will just show a blank white page and the progress bar is
    > > loading so slow. However after it is loaded, the subsequent pages is
    > > loaded up almost instantly. And even after i close my IE and reopen
    > > again and load up the website again, it is still instantly loaded up.
    > >
    > > Somehow the problem only appear after the website is not access for a
    > > long period. How can i solve this problem? My IIS server is always on.
    > >
    > > Thanks.
    > >

    >
    >
     
    Alvin Bruney, Jan 6, 2004
    #3
  4. Shige

    Hermit Dave Guest

    Re: It takes around 30~60 seconds to load a aspx site for the first time. Why?

    Yes i agree that ngen isnt the best option...
    Yes i did mention that JIT compiles what it think is going to be requied...
    if its a heavy page...with reference to a whole lot of other class then a
    big chunk would need to be compiled... and then all would need to be
    initialised and allocated memory.. yeap that takes time...
    And no i wasnt blaming JITing process... was just trying to say how it
    works....

    --
    Regards,

    HD

    "Alvin Bruney" <vapor at steaming post office> wrote in message
    news:u$RSyU$...
    > >If you do not change you code over and over, then you might want to give
    > >ngen.exe a try.

    >
    > ngen is mostly a bad idea outside of a web app but frequently a very, very
    > bad idea within the confines of the an asp.net application.
    >
    > Here is why:
    > NGEN cannot make any assumptions for optimization for the run-time
    > environment than that of the JIT because the JIT is actually running in

    the
    > context of the execution environment. That alone causes NGEN to produce
    > sub-optimized code, if not inefficient.
    >
    > Secondly, strongly named assemblies derive absolutely no benefit from NGEN
    > since NGEN makes an assumption on domain neutrality only for mscorlib.
    > Strongly named assemblies are always loaded domain neutral so the NGEN'd
    > file is never used to begin with.
    >
    > I'd recommend instead that the startup code be streamlined to run lean and
    > mean reducing start up times. For instance, I sincerely doubt that JIT'ing
    > is responsible for this delay solely. Maybe the application is attempting

    to
    > acquire resources or initializing structures which may be contributing
    > heavily to this delay. Without inspecting the start up times, it is unfair
    > to blame it on the JIT.
    >
    > --
    > Regards,
    > Alvin Bruney
    > Got tidbits? Get it here...
    > http://tinyurl.com/2bz4t
    > "Hermit Dave" <> wrote in message
    > news:%...
    > > Okay.
    > >
    > > A page is not a page any more in the sense of what it used to be in

    > classic
    > > ASP
    > > Its a class and you instantiate an object of it when you make a request.
    > >
    > > The way ASP.NET works is that if there is no compiled copy of the

    code....
    > > the first request would essentially JIT compile the bits of assembly

    that
    > > are needed.
    > > The part that is JIT compiled depends on what run time feels you are

    going
    > > to be using. That is the reason y after the first run you app runs like

    a
    > > treat.
    > > If however you do not use your app for a long time... the JIT'd version

    is
    > > discarded and the next request causes JIT on your assembly to create a
    > > native copy again.
    > > If you do not change you code over and over, then you might want to give
    > > ngen.exe a try.
    > > NGen essentially does a full native compilation of your assembly and

    every
    > > time a call is made to the assembly a check is made to see if there is

    an
    > > existing compiled version. If you have NGen'd your assembly that would
    > > always hold true.
    > >
    > > But also keep in mind that native compiled assemblies are heavier.
    > >
    > > --
    > > Regards,
    > >
    > > HD
    > >
    > > "Shige" <> wrote in message
    > > news:3ff8f6be$...
    > > > I have a .Net website hosted on another IIS6.0. Whenever I tried to
    > > > access my website after a long time, it will take forever to load, my
    > > > browser will just show a blank white page and the progress bar is
    > > > loading so slow. However after it is loaded, the subsequent pages is
    > > > loaded up almost instantly. And even after i close my IE and reopen
    > > > again and load up the website again, it is still instantly loaded up.
    > > >
    > > > Somehow the problem only appear after the website is not access for a
    > > > long period. How can i solve this problem? My IIS server is always on.
    > > >
    > > > Thanks.
    > > >

    > >
    > >

    >
    >
     
    Hermit Dave, Jan 6, 2004
    #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. tshad
    Replies:
    7
    Views:
    16,998
    tshad
    Mar 11, 2005
  2. 00_CP_D12
    Replies:
    3
    Views:
    8,932
    dilipv
    Feb 22, 2008
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,003
    Smokey Grindel
    Dec 2, 2006
  4. DeanB
    Replies:
    12
    Views:
    525
    Alexey Smirnov
    Oct 10, 2009
  5. Michael Tan
    Replies:
    32
    Views:
    997
    Ara.T.Howard
    Jul 21, 2005
Loading...

Share This Page