Last post Feb 20, 2007 08:42 PM by bob_m
Feb 16, 2007 07:06 PM|kinnus|LINK
We have a web application written in ASP.Net using C#. It runs pretty fast when run locally, however when run a QA or Production machine, its pretty slow. It seems like the ASP.Net worker process recompiles every time a page is requested.I know
that the first time a page is requested, it compiles and its usually slow, however even after visiting a page say x.aspx and then moving to y.aspx and then returning back to x.aspx it takes a long time. I have even changed the compilation tag's
numRecompilesBeforeAppRestart attribute to a high value as shown below
However still the application starts of fast but gets slower and slower.
Thanks in advance
Feb 17, 2007 01:18 AM|JoshStodola|LINK
It typically runs slow to begin with and then picks up speed. Odd! I assume you are running with debug="false"
Also, did you publish web site (precompiled) or do a direct copy?
Feb 18, 2007 06:56 AM|bob_m|LINK
I have the same problem with a small ASP site. The differnce is mine will pick up speed once it does the first compile. It seems if I leave the site and come back to it in 10 min it has to recompile again. Is there anything I can do about that? I just
copied up source, Do I need all the CS files, at this point I am not using any code. I know when I create a new page it asks me if I want to put the code inside of the HTML file or in external, I alwasy choose external. I am using VWD.
Feb 19, 2007 01:13 PM|JoshStodola|LINK
You didnt answer my question clearly. I need to know if you are just copying and pasting your web sites files or if you are using Visual Web Developers "Publish Web Site" option.
If you are just doing a copy - then try Publishing (Build menu | Publish Web Site). This will pre-compile all of your code and it will give your web site a slight performance boost; especially during the first request.
The first request to a site right after you have deployed it will always take a significant amount of time; there is a lot of things happening in the background.
Hope this helps - Please mark most helpful post as "Answer" when youre issue has been resolved. Thanks.
Feb 19, 2007 03:49 PM|bob_m|LINK
>You didn’t answer my question clearly. I need to know if you are just copying and pasting your web sites files or if you are using Visual Web Developers "Publish Web Site" option. >
Sorry, just copying and pasting.
(note: I am not the original poster)
>If you are just doing a copy - then try Publishing (Build menu | Publish Web Site). This will pre-compile all of your code and it will give your web site a slight performance boost; especially
during the first request.<
Ok, I am publishing to a host, where will the pre-compile version of the code reside, in the bin directory?
Just trying to see how this works.
>The first request to a site right after you have deployed it will
always take a significant amount of time; there is a lot of things happening in the background.<
I can live with this, but when I go away for some time, (say 10 Min) the site seems sluggish on that first attempt.
Since this is a hosting environment I assume they have multiple sits on the machine I happen to be on.
Is this because the site is moving out of cache, or they force a recompile after a certain time-out of inactivity?
Feb 19, 2007 04:06 PM|JoshStodola|LINK
Sorry Bob, I did not realize you were not the original poster.
First of all: When you publish/pre-compile a web site, all of the code goes into the bin folder.
Now some explanation and tips for the slow application (make sure you have debug=false in web.config):
The ASP.NET worker process (aspnet_wp.exe) for your app will only keep itself alive if it's getting a certain amount of requests. If it get's no requests in a specified amount of time, it will be shutdown. You can modify this attribute if you are running
on .NET 2.0. I believe the default for this time is 90 seconds. The main cause of the delay is that after the worker process shuts down, the next request will require a pre-compile of everything again. You can modifiy this setting (httpRuntime shutdownTimeout)
in web.config under the system.web element:
Note that the time given to this attribute is in MINUTES.
Hope this helps!
Feb 19, 2007 08:02 PM|kinnus|LINK
This is kiran again. Thanks for the reply. I shall try the settings within the web.config file that you mentioned.
However Let me tell you a bit more about how the website is hosted. The QA machine is a windows 2000 server. Once the QA build is done, the website can be accessed at say http:xxx.yyy.xx.xxx. It runs fine, in the sense it does not crash or anything, but
certain links or tabs which when clicked takes a long time that it took initially.
Like say a tab called 'x' was clicked and it took 2 seconds to open say after clicking a few links we come back and click the tab called 'x' again this time it took like 14 seconds instead of 2 or say fewer seconds.
I was checking to see if anybody had this issue and i found this link. His issue did sound like my issue.
Feb 20, 2007 08:42 PM|bob_m|LINK
Sorry to hijack your thread here above. Strangely, I had a similar problem to yours when I first started working with asp.net. See thread here,
I was using integrated authentication at the time to protect the site and that was causing all sorts of headaches on the site. Turning that off helped. From my limited experience with aps.net it always seems to be slower then it should be. Just count the
seconds it takes to post a message on this site at times. :)