Performance issues with ASP.NET web application - Slow response

Discussion in 'ASP .Net' started by Ram, Sep 1, 2005.

  1. Ram

    Ram Guest

    Hi
    After deploying a simple web application to the production environment, I see that hwne I launch my app's url it takes a while to load the home page.(it doesnt do anything complex. A pretty simple adn straightforward page with just a few text boxes and a button). After that the app's response time is reasonably fast. Any idea why the response time is slow? Is it something to do with ASP.NET's engine? I noticed it in the test environment but thought it would be working fine in prod.

    Please help.

    From http://www.developmentnow.com/g/8_0_0_0_0_0/dotnet-framework-aspnet.htm

    Posted via DevelopmentNow.com Groups
    http://www.developmentnow.com
     
    Ram, Sep 1, 2005
    #1
    1. Advertisements

  2. Ram

    Ben Guest

    Ram,

    Look into the Common Language Runtime (CLR) and Just-In-Time (JIT)
    compiling.

    Basically, your asp.net source code is compiled into an intermediate
    language (IL) by your compiler and is JIT compiled into machine language the
    first time it is executed. After that it executes without the machine
    language compile (a.ka. full speed ahead). The dll's of your project are
    made a dependancy of the newly JIT'ed code. If any of the dll's change, the
    code will be JIT'ed again.

    HTH,
    Ben
     
    Ben, Sep 1, 2005
    #2
    1. Advertisements

  3. Hi
    Thanks. I am aware that it JIT's for the first launch. However, each
    time I open the browser window afresh and type in my website's url, the
    home page takes a while to load. The dependecies haven't changed either.
    Any other settings that I have overlooked?

    Thanks
    Ram
     
    Ramkumar Thirumangalam, Sep 1, 2005
    #3
  4. Ram

    Josh Rolfe Guest

    (See previous post about JIT compiling)
    To increase the performance of the inital hit you can remove the
    "codebehind=..." attribute of your <%@Page directive and deploy your
    compiled dll's along with your aspx pages. Or you can hit the page yourself
    immediately after deployment.
     
    Josh Rolfe, Sep 1, 2005
    #4
  5. Ram

    Ben Guest

    Yep, there is... The machine language code is only retained in memory for
    the life of the application. That is to say, from the first request on the
    application until the last request fires session_end. Once the last request
    fires session_onend, the JIT'ed information is garbage collected.

    If you're saying that you're opening one window, then another right away I'm
    not sure. I'd have to inquire about what you may or may not be doing in
    things like session_start etc.

    Ben
     
    Ben, Sep 1, 2005
    #5
  6. Ram

    Brock Allen Guest

    JITing is a red herring in the slow start times of ASP.NET. It's part of
    it, but it's not the entire story. The two other main factors are 1) loading
    the Win32 process that will be hosting your app, and 2) launching the AppDomain
    to host the ASP.NET app. Those two things (more the latter than the former)
    is doing a lot of work and initilization to get started. Sorry, but it's
    just the cost of doing business.
     
    Brock Allen, Sep 2, 2005
    #6
  7. Ram

    codezilla94

    Joined:
    Nov 13, 2007
    Messages:
    4
    Likes Received:
    0
    ASP.NET Slow Response Time (Workaround)

    I had the same problem. The reason is that the application domain times out every 20 mins if there is no activity, the first request after the timeout can force a recompile and reload of cache. Changing some settings in the machine.config file will solve the problem; unfortunately for me my hosting provider would not allow me to make this change. I found this utility to be useful.

    http://www.spikesolutions.net/ViewSolution.aspx?ID=c2b7edc0-5de1-4064-a432-05f6eded3b82

    Essentially it "Pings" my home page every few mins so the application domain does not time out. The utility can also be configured to ping more than one page so that auxiliary pages are fast too.
     
    codezilla94, Nov 13, 2007
    #7
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.