Why is page display so slow from precompiled site?

J

John Kotuby

Hi all,

Within an IFRAME of a standard site constructed of mostly static HTM type
pages, I am calling up one page from a large ASP.NET 3.5 site. I have
precompiled the ASP.NET site and published. "Allow precompiled site to be
updateable" is NOT checked. "Enable strong naming on precompiled assemblies"
is NOT checked. However, "Use fixed naming and single page assemblies" IS
checked. I did with the idea that if I call a single page from another site
it will display faster if it is contained in its own assembly and maybe I am
entirely wrong on that account.

In the web.config of the development machine where I precompile the site I
have
<compilation debug="true" strict="false" explicit="true">

I precompile to a local folder then ftp the site to the production server.

However when I upload the precompiled site the web.config on the production
server has
<compilation debug="false" strict="false" explicit="true">

Maybe I need to change my dev machine web.config every time I precompile for
publishing?

There are 182 objects in the bin folder of the precompiled site. 92 objects
are dll assemblies. 84 objects are small files with .compiled as the
extension. Other files are 3rd party licenses and a couple XML files. There
are no .vb files in the entire deployed site

It takes 15 seconds to load that single page the first time in the morning.
Subsequent calls to that page (even after session timeout) take 2-3 seconds
max. The page uses Session state. It also calls 4 other pages if the user
clicks on certain links. It almost seems as if the entire site is being
recompiled by calling that single initial page.

The page runs 2 simple SQL queries to display all the managed properties
held by the owner of the public site within a grid and then allows searching
to narrow down the selection. I just tested both queries on our slower SQL
Server here at the office and they each took less than 1 second as the first
queries in the AM.

I understand that there are many factors that determine how quickly a page
arrives at the browser.

Can anyone suggest what I might do with the precompile deployment that would
speed things up? I think I must be making a big mistake somewhere.

Thanks for any help with this.
 
B

bruce barker

..net code has two compiel steps. the first produces a dll/exe with il code
which is machine independent. when you first run a .net app, it need to
convert the il code to machine code, this is done evreytime you run the app.

in asp.net when you first hit a site it does a lot of work. it creates an
appdomain to run the .net code in. it loads and compiles (called jit) all
dll's in the bin folder. it also resolves and load any reference to a gac
assembly.

you can speed up startup a little by using aspnet_merge to produce one
assembly. also you shoudl stepa heath tester that hits your site an reports
on health. this will have the side benefit of keeping the site loaded.


-- bruce (sqlwork.com)
 
J

John Kotuby

Thanks Bruce,
I guess setting up a site "health" tester would keep the site "warm" as I've
read in an article. Thanks for the quick explanation.
 
J

jturner

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top