Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Why are my asp pages running so slow?

Author  Topic 

missinglct
Yak Posting Veteran

75 Posts

Posted - 2004-05-17 : 13:04:26
I know this is not the right forum to post this question but I posted it here anyway just in case there is some one who have run acrossed this before. Any input on where I can get some more help on ASP questions would be greatly appreciated.

I have written some asp (Active server page) pages that have a mix of html, sql and vbscript (asp). On these pages, I have used some DO WHILE NOT loops. When I execute these pages on the INTRANET website, I have no problem. But when I execute these pages on the INTERNET, they run really really really slow. I mean they are very slow. And sometimes at the end of the execution, it displays an error message: "Time is running out."

Thank you for any input.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-17 : 13:33:08
This sounds like a network problem. The speeds of the two networks are probably way different. I would contact your network administrator to figure out how fast it should be and what problems you are encountering that is causing this. He/she can turn on network logs to capture the network traffic.

Tara
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-17 : 13:33:38
I would guess either the server is very slow or you have some client interaction within the loop.
Try putting in some logging so you can see which parts are slow.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-17 : 14:33:26
First find out where the problem is.
There's no point in going to the network admin unless you know it's a network problem - you should get a lot of info by adding some logging to your app.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-17 : 14:44:15
Just log to a text file what is happenning at various points in your code.
do you have a data access layer? If so then it's worthwhile putting in a trace of all database calls so you can see how long they are taking.
You might find that you can already get stats on the page interactions.

The main thing is to find out whether it is your code that is causing the problem or the delivery of the data to the client.
As you mentioned loops I guess you think the problem may be there.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

TurdSpatulaWarrior
Starting Member

36 Posts

Posted - 2004-05-17 : 15:06:28
Perhaps you could post the code to the ASP page you are speaking of for us to take a look at it?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-17 : 15:32:25
You are getting a resultset for each row of a resultset - very bad and slow.
Should redesign this to get a single resultset which contains all the info you need then just process that.

For logging just open a text file - write a line including the datetime when the page starts and when it ends.
See Scripting.FileSystemObject

Could it just be the amount of data you are sending back to the client?

I do database access using something like this so I have a single place to make changes.
http://www.nigelrivett.net/DBAccess.inc.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

TurdSpatulaWarrior
Starting Member

36 Posts

Posted - 2004-05-17 : 16:48:24
At least you know to close and clean up your connections! I can't tell you how many times I've "inherited" code from new clients or other developers that never bothered to do so.
Go to Top of Page

stephe40
Posting Yak Master

218 Posts

Posted - 2004-05-24 : 15:53:17
Have you tried running the queries themselves with the Query Analyzer both on the intranet and internet? Are the execution times of those different?

- Eric
Go to Top of Page

missinglct
Yak Posting Veteran

75 Posts

Posted - 2004-05-24 : 16:04:38
They both are very quick using QA :)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-24 : 16:07:26
You might want to try the ASP forum at http://www.asp.net :

http://www.asp.net/Forums/ShowForum.aspx?tabindex=1&ForumID=170

Tara
Go to Top of Page

missinglct
Yak Posting Veteran

75 Posts

Posted - 2004-05-24 : 16:23:06
Thank you Tara. I will post my question somewhere else :)
Go to Top of Page

stephe40
Posting Yak Master

218 Posts

Posted - 2004-05-24 : 16:29:51
quote:
Originally posted by missinglct

They both are very quick using QA :)



Ok, then I would try stripping down the page to nothing, then running it without any db calls. Make sure it works fine. And then selectivly add the queries and other large blocks of code individually until you reach the point where the execution gets delayed. Then you should be able to figure out what block of code is the culprit and then narrow it down to what in the block is taking forever.

HTH

- Eric
Go to Top of Page
   

- Advertisement -