Forum Moderators: open

Message Too Old, No Replies

Performance problems with asp

         

szb100

1:24 pm on Jun 5, 2004 (gmt 0)

10+ Year Member



I am having some frustrating performance problems with asp. The actual scripts seem to execute fine and the webpage displays at least partially, but the browser (tested in all of them pretty much) stays busy for ages.

This morning I gave all my scripts a thorough going through tweaking them for performance but with little effect. I've now taken a step back and have identified some things that may be possibilities but have not found much on them to help me.

The possibilities I wondered about are:
I have modularised my code too much and the use of includes (10 on one page) is slowing it down
My method for dealing with recordsets is wrong. I use about 6 recordsets on a page. Only one is open at any time, but I am using 6 recordset objects with different names, and closing & setting each one to nothing after use. Would it be better only having one recordset object and just opening/closing it?

I've tried some testing. The most common error I get is that the page appears minus its CSS, and the browser stays busy for ages. What could the browser be doing? It has processed the script, so what is keeping it busy?

Any advice on how to narrow down the cause or on the suggestions above is greatly appreciated.

Matt

Spooky

2:26 pm on Jun 5, 2004 (gmt 0)

10+ Year Member



Are you testing locally?
If so - and you use Norton, turn of nortons script blocking

szb100

2:51 pm on Jun 5, 2004 (gmt 0)

10+ Year Member



Script blocking is off - I remember I did that when I first started web design work!

I am testing locally. There is a version at www.nailthetruth.com/header.asp but its just taking too long to get anything coming up there.

Spooky

3:06 pm on Jun 5, 2004 (gmt 0)

10+ Year Member



Probably best then to comment out some of the potential server hogs - start with no database calls and see what happens.
Re-enable them one by one until you have an error / timeout.

Check for endless loops, unnecessary queries (select * ...) etc
Use OLEDB, not DSN / OBDC

duckhunter

4:17 am on Jun 6, 2004 (gmt 0)

10+ Year Member



Good advice Spooky.

Are you opening/closing a DB connection with each RS too? Make sure you only have one that each RS uses.

szb100

9:00 am on Jun 6, 2004 (gmt 0)

10+ Year Member



Are you saying you need to open a separate connection for each record set you use?
I am doing:
Open conn
Open rst1
Close rst1
open rst2
close rst2
open rst3
close rst3
close conn
etc etc.

Should I be doing:
Open conn
open rst1
close rst1
close conn1
open conn2
open rst2
close rst2
close conn2

?

Doing it that way sounds a bit odd to me, but maybe thats what I'm doing wrong...

duckhunter

3:37 am on Jun 7, 2004 (gmt 0)

10+ Year Member



No, you're doing it right. "Make sure you only have one that each RS uses."

Just checking as some people will open and close connections each time which IS very expensive. Did you try Spooky's advice? One RS at a time.

wackal

9:13 pm on Jun 7, 2004 (gmt 0)

10+ Year Member



not sure if you're doing this, but try to use

Response.Buffer = True

and

Option Explicit

at the top of your asp page.

szb100

8:03 pm on Jun 8, 2004 (gmt 0)

10+ Year Member



Thanks for the tips folks.
To be honest I tried everything, and then just started fiddling aimlessly - somewhere, sometime it all started to work again so I'm happy now!

Heres hoping it wont go that dramatically wrong again...

raptorix

10:59 am on Jun 11, 2004 (gmt 0)

10+ Year Member



When you have bad performance locally, its normally caused by bad database queries, what you can do is run the commands directly on your dbase and check the response time, a good start is to check or you did build the correct indices on the tables, also querying with '%foo%' can slow down extremely since your index is ignored with those kind of searches.