StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



ASP.NET 2.0 website with SF optomizationExpand / Collapse
Author
Message
Posted 02/06/2007 10:10:52 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:38:08 PM
Posts: 617, Visits: 18,127
I just published a SF/SQL website and the first time a visitor goes to the site, the pages are slow to load. My understanding of this is because the HTML is dynamically rendered in ASP.NET and the first time it essentially just takes longer.

Is there any way to speed this up other than throw hardware at it?

The initial pages are not complex but still take 3-10 seconds to load the first time, subsequent visits are much faster but I think this still leaves the wrong initial impression.

Any help or insight will be appreciated.
Post #6584
Posted 02/06/2007 11:15:08 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
Actually the problem is that the website is compiling the first time a visitor is showing up at your site, and thus the slowness.  You need to precompile your website to resolve this issue.  .NET comes with an ASP compiler that will do this for you and can even be added to a post build event, or just added to a batch file.  This is basically the same thing as right-clicking the web site and then clicking publish.  Using the command line option will allow you to add any additional copy commands after the aspnet_compiler and place it in a general location so that you can upload is separately if you need to.  Below is an example of how to pre-compile a site.

aspnet_compiler -p "c:\MyDevWebSite\" -v / "c:\Output\compiled site"

FYI, you can run this through the Visual Studio command prompt or just directly call it.  This file is located "C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe".

Post #6587
Posted 02/06/2007 11:49:22 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:38:08 PM
Posts: 617, Visits: 18,127
I thought I did that, maybe I did it wrong. Attached is a SS of how I published, then I copied the resultant directory to my web server via FTP.

Am I lost?



  Post Attachments 
compile_options.jpg (78 views, 31.93 KB)
Post #6589
Posted 02/06/2007 12:29:13 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
No.  It generally this will work.  You might try the manual option.  Now keep in mind that the very first visitor after IIS has been restarted might take just a second to load the site.  However, after this it should always be fast.  You can be the "first visitor" to make sure the site is loaded.  Afterwards though, it should be fast for all other visitors.
Post #6590
Posted 02/07/2007 9:50:06 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/01/2008 8:53:41 AM
Posts: 2,671, Visits: 1,879
Pre-compiling the website is supposed to fix the 1st page load slowdown because the when the page is stale, it has to be recompiled. 

However, if you're still getting very poor responsiveness for the first page request, you can try some other things:

1) Put the website in it's own application pool
2) Place a standard .html file in the site and see if it takes as long as the .aspx pages do


www.bungie.net
Post #6611
Posted 08/09/2007 11:11:28 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/18/2008 9:16:20 PM
Posts: 1, Visits: 15
Another option I find helpful is to disable idle timeouts on the Application Pool in IIS.  Do that under the Performance tab of the Application Pool.  Either uncheck the idle timeout checkbox or set it to a higher value.  I have noticed that over weekends where I work the IIS worker processes will shutdown making our ASP.NET websites slow to load on Monday morning.  By removing the idle timeout we don't have to worry about it.  I would not recommend doing this to the Default pool though so create a new pool, add your site to that pool, and remove the idle timeout.
Post #10788
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:41pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.