dcsimg
www.webdeveloper.com
Results 1 to 15 of 15

Thread: asp.net (VB) pages very slow to load up 1st time

  1. #1
    Join Date
    Feb 2005
    Location
    Liverpool
    Posts
    134

    asp.net (VB) pages very slow to load up 1st time

    Hi,

    I've got this really odd problem which im hoping is an easy one - something i've missed.

    Im building a company intranet with ASP.net (VB) and an access 2003 database to hold the data - not alot of data. The problem is when ever anyone loads a page for the 1st time its really slow to load up (approx 1-2mins), once anyone has loaded that page the server caches it and anyone including others can use that page at which point it loads between 1-3secs.

    Im running Server 2003, with .NET framework 2.0 and IIS 6. The browsers the company run are all IE7.

    Any ideas?

    Thanks in advance

  2. #2
    Join Date
    May 2007
    Location
    Beijing - China
    Posts
    49
    You mean it take that long the first time the web site are accessed after being re-build, or each time a user visit it the first time.

    Suggest you put a break-point in you main page's load event, and run it in debug mode on your developer machine. Could be you are calling some long running code (like database reads) serveral times due to post backs occuring.

  3. #3
    Join Date
    Feb 2005
    Location
    Liverpool
    Posts
    134
    Hi,

    I meant it takes a long time the first time after the site is built again or loaded first thing in the morning.

    For example i left the site working fine last night (5pm), pages where loading quickly etc. When i have come in this morning the same has happened its takes ages to load up, now its loaded once however anyone on the network including me could go on the page and it would load up within a second or two.

    any ideas?

  4. #4
    Join Date
    May 2007
    Location
    Beijing - China
    Posts
    49
    Is this the only website on the server? If so, is the others fine?
    If not, create another website, just a simple single page, and see how it load over the network.

    Really not enough details to give you any specific advice.
    What happens when your website loads...Do you have code in your "Application_Start" Event?

  5. #5
    Join Date
    Feb 2005
    Location
    Liverpool
    Posts
    134
    This is the second Intranet on the server, the old one will be de-comissioned when this one is ready. The old Intranet was designed using asp and runs quick and error free, but as soon as the server sees an aspx page it stalls for the first time an aspx page loads.

    Just tried it this morning - i loaded up the index.aspx page (home page) then tried the other pages, the first page took ages to load, then for some reason the other pages all loaded really quickly, so i think that the server has a problem initiating the .net framework or something???

  6. #6
    Join Date
    Jan 2007
    Posts
    18
    When you build a .net web application, you can either pre-compile it, or you can have the server compile it at runtime.

    Pre-compiling it will do away with the "lag" you're talking about...but...everytime you make a change anywhere in the application you will have to recompile it again.

    Letting the server compile it at runtime will result in the "lag" - but it should only do that the first time the app is run...at least until someone makes a change to something and it will have to recompile it again at runtime.

    The only reason I can think of that it would lag like that just overnight ( assuming you didn't change anything in the app during the afternoon or whatever ) is if you turn the server off at night. Does it run all night or does it get shut down?

  7. #7
    Join Date
    Feb 2005
    Location
    Liverpool
    Posts
    134
    Thnaks for that.

    The server runs all night, the only thing i can think of is that when the backups are done, its flushing the server - what do you think?

    I do like the idea of pre-compiling asp.net pages, before i go on a google hunt do you have any good information etc to precompile, i've never done it before.

    Many thanks

  8. #8
    Join Date
    Jan 2007
    Posts
    18
    I know enough about servers to get myself into trouble - that's about it

    So I really don't know but I wouldn't think doing backups would affect it.

    I can't help with pre-compiling your app...we never pre-compile them here where I work because we have hundreds of websites and many of them are being updated frequently. That would mean lots of extra work everytime a change is made. We just let the servers compile them on the fly.

    Don

  9. #9
    Join Date
    May 2007
    Location
    Beijing - China
    Posts
    49
    What is with this server compiling whatever?
    You guys make it sound like you are running something like visual studio on your production servers....?????

    All you should have on your server is the .net framework you are using, IIS configured to use it, and only your pages (no code-behind), and your application's dll, along with any other dll's you allready compiled on your develoment system, and 3rd party components you might be using.

    I guess I understand you wrong, because that assumption just sound a bit too ridiculous to be true

  10. #10
    Join Date
    Jan 2007
    Posts
    18
    Well, not everybody does things that way.

    I don't use Visual Studio myself...I hand code everything. Therefore, there are no dll's being sent up to the server. So when someone requests the webpage, the server compiles the dll at runtime.

    Don

  11. #11
    Join Date
    May 2007
    Location
    Beijing - China
    Posts
    49
    I'm going to risk the possibility of eating humble pie later, by saying that is not the way to do things.

    Even without using Visual Studio, you should compile your project from the command line.

    As far I'm concerned, Microsoft's idea of "compile on demand" turned out to be nothing but an empty marketing glitch.

    Pandora's box is open....fire away

  12. #12
    Join Date
    Jan 2007
    Posts
    18
    When it comes to web applications, I see no advantage ( other than the subject of this topic - the initial "lag time" on the first run ) to pre-compiling. I've read lots of articles going back and forth over this issue, and there doesn't really seem to be any clear advantage to doing so.

    >>>As far I'm concerned, Microsoft's idea of "compile on demand" turned out to be nothing but an empty marketing glitch.

    I don't see how you can possibly come to that conclusion. I've written thousands of aspx pages over the past few years that all work just fine being compiled on demand by the web server.

    IF you are working on a very large and complex web application, and writing the entire thing in .net, then I can see where it would be a good idea to compile it into a dll. The point is...you don't absolutely have to do so.

    Don

  13. #13
    Join Date
    May 2007
    Location
    Beijing - China
    Posts
    49
    Quote Originally Posted by donwyo
    When it comes to web applications, I see no advantage ( other than the subject of this topic - the initial "lag time" on the first run ) to pre-compiling. I've read lots of articles going back and forth over this issue, and there doesn't really seem to be any clear advantage to doing so.
    Don
    I guess you are right.....but then, I'm not the one with this problem..never had
    Quote Originally Posted by donwyo
    >>>As far I'm concerned, Microsoft's idea of "compile on demand" turned out to be nothing but an empty marketing glitch.
    I don't see how you can possibly come to that conclusion. I've written thousands of aspx pages over the past few years that all work just fine being compiled on demand by the web server.
    if (microsoft.say("The sky is green")) {
    sky="Blue";
    }

  14. #14
    Join Date
    Jan 2007
    Posts
    18
    LOL

    Point.WellTaken

    Don

  15. #15
    Join Date
    Jun 2007
    Posts
    17
    Mike's idea of "compile on demand" because her os compiled!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles