473,394 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ASP performance issues

I have a page that is linked into by other pages that pass it query
strings, it then reads a config file, displays 1 of several forms, gets
posted to itself, depending upon users response may display a different
form etc etc.

I want to take the config data and have that read by a globals.asa and
then use application("VariableName") to reference it.

i also want to take the initial query strings and load them into session
variables.

Problem is, whats does a globals.asa file look like? how do i build one?
how do i make it referenced in my page?

Thanx
Woody
any sugestion or comment made by me should be examined first for
validity and appropriateness before assuming i have any idea at all
what the heck i am talking about. I am not responsible for anything you
may see with my name attached to it, i think.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
10 1720
ummm... what does this have to do with global.asa? as far as I can see
your objective has nothing to do with it. but maybe if you were more
clear about your explanation it'd help...

________________________________________
Atrax. MVP, IIS
http://rtfm.atrax.co.uk/

newsflash : Atrax.Richedit 1.1 in beta with Mozilla-compatibility.
http://rtfm.atrax.co.uk/infinitemonk...trax.RichEdit/

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #2
Woody wrote:
I have a page that is linked into by other pages that pass it query
strings, it then reads a config file, displays 1 of several forms,
gets posted to itself, depending upon users response may display a
different form etc etc.

I want to take the config data and have that read by a globals.asa and
then use application("VariableName") to reference it.

i also want to take the initial query strings and load them into
session variables.

Problem is, whats does a globals.asa file look like? how do i build
one? how do i make it referenced in my page?


Here is the default global.asa page created by Interdev:

************************************************** ****************
<SCRIPT LANGUAGE=VBScript RUNAT=Server>

'You can add special event handlers in this file that will get run
automatically when
'special Active Server Pages events occur. To create these handlers, just
create a
'subroutine with a name from the list below that corresponds to the event
you want to
'use. For example, to create an event handler for Session_OnStart, you would
put the
'following code into this file (without the comments):

'Sub Session_OnStart
'**Put your code here **
'End Sub

'EventName Description
'Session_OnStart Runs the first time a user runs any page in your
application
'Session_OnEnd Runs when a user's session times out or quits your
application
'Application_OnStart Runs once when the first page of your application is
run for the first time by any user
'Application_OnEnd Runs once when the web server shuts down

</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
End Sub
</SCRIPT>
************************************************** *********

The global.asa page is run whenever one of the 4 events mentioned in the
comments section above occurs. You do NOT refer to global.asa in any of your
other pages. You simply use the application and session variables that may
have been created in global.asa.

HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #3
Doesn't this impose a performace issue? doesn't global.asa get read
everytime, by every script? What happens if you have a lot of arb stuff in
global.asa, which is only used in one script, each one of those items as
needed? Won't this have performance implications on the whole site?

--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:#g**************@TK2MSFTNGP11.phx.gbl...
Woody wrote:
I have a page that is linked into by other pages that pass it query
strings, it then reads a config file, displays 1 of several forms,
gets posted to itself, depending upon users response may display a
different form etc etc.

I want to take the config data and have that read by a globals.asa and
then use application("VariableName") to reference it.

i also want to take the initial query strings and load them into
session variables.

Problem is, whats does a globals.asa file look like? how do i build
one? how do i make it referenced in my page?


Here is the default global.asa page created by Interdev:

************************************************** ****************
<SCRIPT LANGUAGE=VBScript RUNAT=Server>

'You can add special event handlers in this file that will get run
automatically when
'special Active Server Pages events occur. To create these handlers, just
create a
'subroutine with a name from the list below that corresponds to the event
you want to
'use. For example, to create an event handler for Session_OnStart, you would
put the
'following code into this file (without the comments):

'Sub Session_OnStart
'**Put your code here **
'End Sub

'EventName Description
'Session_OnStart Runs the first time a user runs any page in your
application
'Session_OnEnd Runs when a user's session times out or quits your
application
'Application_OnStart Runs once when the first page of your application is
run for the first time by any user
'Application_OnEnd Runs once when the web server shuts down

</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
End Sub
</SCRIPT>
************************************************** *********

The global.asa page is run whenever one of the 4 events mentioned in the
comments section above occurs. You do NOT refer to global.asa in any of your
other pages. You simply use the application and session variables that may
have been created in global.asa.

HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jul 19 '05 #4
global.asa is run once upon accessing the first *.asp page in an
application.

Bob Lehmann

"Lord Merlin" <SP*************@Bonzai.org.za_SPAM> wrote in message
news:ca**********@ctb-nnrp2.saix.net...
Doesn't this impose a performace issue? doesn't global.asa get read
everytime, by every script? What happens if you have a lot of arb stuff in
global.asa, which is only used in one script, each one of those items as
needed? Won't this have performance implications on the whole site?

--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends (John 15:13).
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:#g**************@TK2MSFTNGP11.phx.gbl...
Woody wrote:
I have a page that is linked into by other pages that pass it query
strings, it then reads a config file, displays 1 of several forms,
gets posted to itself, depending upon users response may display a
different form etc etc.

I want to take the config data and have that read by a globals.asa and
then use application("VariableName") to reference it.

i also want to take the initial query strings and load them into
session variables.

Problem is, whats does a globals.asa file look like? how do i build
one? how do i make it referenced in my page?

Here is the default global.asa page created by Interdev:

************************************************** ****************
<SCRIPT LANGUAGE=VBScript RUNAT=Server>

'You can add special event handlers in this file that will get run
automatically when
'special Active Server Pages events occur. To create these handlers, just
create a
'subroutine with a name from the list below that corresponds to the event
you want to
'use. For example, to create an event handler for Session_OnStart, you

would put the
'following code into this file (without the comments):

'Sub Session_OnStart
'**Put your code here **
'End Sub

'EventName Description
'Session_OnStart Runs the first time a user runs any page in your
application
'Session_OnEnd Runs when a user's session times out or quits your
application
'Application_OnStart Runs once when the first page of your application is run for the first time by any user
'Application_OnEnd Runs once when the web server shuts down

</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
End Sub
</SCRIPT>
************************************************** *********

The global.asa page is run whenever one of the 4 events mentioned in the
comments section above occurs. You do NOT refer to global.asa in any of your other pages. You simply use the application and session variables that may
have been created in global.asa.

HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #5
Lord Merlin wrote:
Doesn't this impose a performace issue? doesn't global.asa get read
everytime, by every script?


No. Global.asa is run only during the events shown in the sample page
comments section. Pages access session variables and application variables.
Your pages do NOT run the code in the global.asa file. The code in the
global.asa file is run by your web server:

a) when the application starts
b) when a session starts
c) when a session ends
d) when the application ends

I don't know how to say it any clearer than that. I suspect you need to do
some reading of the ASP documentation at msdn.microsoft.com. Here's a link:
http://msdn.microsoft.com/library/en...dk/iis/asp.asp

and

http://msdn.microsoft.com/library/en..._web_pages.asp

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #6
ok, why is it then a bad idea putting your DB connections strings into
global.asa, when not all of your scripts would access the DB? I have found
that if I remove the DB connection strings, and only include them into the
files that access the DB, my site seems to be quicker

--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
Lord Merlin wrote:
Doesn't this impose a performace issue? doesn't global.asa get read
everytime, by every script?


No. Global.asa is run only during the events shown in the sample page
comments section. Pages access session variables and application variables.
Your pages do NOT run the code in the global.asa file. The code in the
global.asa file is run by your web server:

a) when the application starts
b) when a session starts
c) when a session ends
d) when the application ends

I don't know how to say it any clearer than that. I suspect you need to do
some reading of the ASP documentation at msdn.microsoft.com. Here's a link:
http://msdn.microsoft.com/library/en...dk/iis/asp.asp

and

http://msdn.microsoft.com/library/en..._web_pages.asp

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jul 19 '05 #7
Lord Merlin wrote:
ok, why is it then a bad idea putting your DB connections strings into
global.asa, when not all of your scripts would access the DB?


It's not. Who told you this??? There is absolutely no performance issue with
storing ANY string, let alone connection strings, in Application or Session.
Maybe you are confusing the advice against storing COM objects in
Application and Session.
COM objects, such as ADO connections, by default, are apartment-threaded,
and should not be stored in Application or Session. They are not designed to
be used by the multiple threads involved in a web server application. Go
back to aspfaq and read about this again:
http://www.aspfaq.com/show.asp?id=2053

The advice is about COM objects, not strings and numeric data.

BTW, it is possible to modify a Registry key on your web server to make the
ADO objects free-threaded instead of apartment-threaded, allowing them to be
safely used in Application or Session. A batch file called makfre15.bat is
usually installed in C:\Program Files\Common Files\System\ADO to automate
making this change. A major caveat is to avoid doing this when using a Jet
database, because Jet is single-threaded. I reiterate: DO NOT DO THIS WHEN
USING ACCESS DATABASES IN YOUR WEB APPLICATIONS.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #8
CJM

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...

BTW, it is possible to modify a Registry key on your web server to make the ADO objects free-threaded instead of apartment-threaded, allowing them to be safely used in Application or Session. A batch file called makfre15.bat is
usually installed in C:\Program Files\Common Files\System\ADO to automate
making this change. A major caveat is to avoid doing this when using a Jet
database, because Jet is single-threaded. I reiterate: DO NOT DO THIS WHEN
USING ACCESS DATABASES IN YOUR WEB APPLICATIONS.

Bob Barrows


Bob,

This is news to me. Have you got any pointers to some background reading on
this?

How do this fit in with our existing Good Practice guides? Is it a Good
Thing (tm) or a Bad Thing (tm)?

Not sure if I could change my habits after all this time! lol

Chris
Jul 19 '05 #9
CJM wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...

BTW, it is possible to modify a Registry key on your web server to
make the ADO objects free-threaded instead of apartment-threaded,
allowing them to be safely used in Application or Session. A batch
file called makfre15.bat is usually installed in C:\Program
Files\Common Files\System\ADO to automate making this change. A
major caveat is to avoid doing this when using a Jet database,
because Jet is single-threaded. I reiterate: DO NOT DO THIS WHEN
USING ACCESS DATABASES IN YOUR WEB APPLICATIONS.

Bob Barrows

Bob,

This is news to me. Have you got any pointers to some background
reading on this?


http://www.insightgraphics.com/refer...PStateMgmt.htm

See Tip 4 on this page:
http://msdn.microsoft.com/library/de...ml/asptips.asp

Interestingly enough, this guy:
http://www.vbxml.com/conference/wrox...immy_cache.pdf
says he could not get a disconnected recordset into Application in IIS5 (it
worked as advertised in IIS4). He surmises that IIS5 is a little " ...
stricter about what counts as an agile object."
..
How do this fit in with our existing Good Practice guides? Is it a
Good Thing (tm) or a Bad Thing (tm)?
I'm not so sure about it being a Good Thing. Maybe for disconnected
recordsets. I can see the benefit of storing one of those in Session. It
does not seem to be a good thing for connections, since it would tend to
defeat connection pooling. Also, if you have any functionality that depends
on discrete database "sessions", then global connections should certainly be
avoided.

Not sure if I could change my habits after all this time! lol

Same here. But the main reason for me is that some of our web applications
are using Jet databases.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #10
CJM

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uw**************@TK2MSFTNGP10.phx.gbl...
Interestingly enough, this guy:
http://www.vbxml.com/conference/wrox...immy_cache.pdf
says he could not get a disconnected recordset into Application in IIS5 (it worked as advertised in IIS4). He surmises that IIS5 is a little " ...
stricter about what counts as an agile object."

It does say that under IIS5, it must be free-threadind AND must aggregate
the free-threading marshaller. Still double-dutch to me(!) but nevertheless
it shows that IIS is a bit more fussy.

How do this fit in with our existing Good Practice guides? Is it a
Good Thing (tm) or a Bad Thing (tm)?


I'm not so sure about it being a Good Thing. Maybe for disconnected
recordsets. I can see the benefit of storing one of those in Session. It
does not seem to be a good thing for connections, since it would tend to
defeat connection pooling. Also, if you have any functionality that

depends on discrete database "sessions", then global connections should certainly be avoided.


Connection Pooling: Agreed

Disconnected RS: It mentions that it is safe to cache disconnected rs's in
Item 5, so I suspect this isnt to do with Item 4.

Interesting: Scripting.Dictionary is non-agile, but there is a (free) 3rd
Party that is and therefore can be cached. Might be useful...

Not sure if I could change my habits after all this time! lol

Same here. But the main reason for me is that some of our web applications
are using Jet databases.


Same here sometimes...
Anyway, thanks for this...

Chris
Jul 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
5
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to...
2
by: Unruled Boy | last post by:
1.The follow two ways to declare one object: any difference? especially its performance. a.Private m_objMyObject As MyObject=New MyObject() b.Private m_objMyObject As MyObject m_objMyObject=New...
9
by: Java script Dude | last post by:
In many languages, it is necessary to string together multiple strings into one string for use over multiple lines of code. Which one is the most efficient from the interpreters perspective: ...
16
by: David W. Fenton | last post by:
http://www.granite.ab.ca/access/performancefaq.htm I hope Tony doesn't mind my opening a discussion of some issues on his performance FAQ page here in the newsgroup. This is not meant as...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
4
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
8
by: Dmitry Akselrod | last post by:
Hi, I have a recursive application that walks through a directory structure on a Hard Drive and writes various file information to a single table in an Access 2003 database. I am opening a...
2
by: Brian Tabios | last post by:
Hello Everyone, I have a very complex performance issue with our production database. Here's the scenario. We have a production webserver server and a development web server. Both are running...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.