iis/asp + sql2000 a bit slow
From: Florian (REMOVEUPPERCASEwizard_oz_at_gmx.net)
Date: 02/06/04
- Next message: Jeff Cochran: "Re: ASP/SQL Query Build - Myth Breaking"
- Previous message: Laphan: "ASP/SQL Query Build - Myth Breaking"
- Next in thread: Bob Barrows: "Re: iis/asp + sql2000 a bit slow"
- Reply: Bob Barrows: "Re: iis/asp + sql2000 a bit slow"
- Reply: Aaron Bertrand [MVP]: "Re: iis/asp + sql2000 a bit slow"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 06 Feb 2004 22:06:20 GMT
I have a performance problem, but I don't really know where the exact cause
lies.
Win2k (all patches) / IIS / ASP + VBScript
I have a table with about 10 columns and almost 1million of records that I
indexed (with index views). The page I'm talking about is doing 9 queries
(all just select) and takes too long to load.
I ran every single on of these queries with the SQL Query Analyzer, looking
at the execution plan. All queries run superfast, so I'm pretty sure that
the problem is not there.
As soon as I run this from the ASP page however it takes almost 1 sec per
query to run, a total of about 6 seconds. I don't see why this doesn't work
in one second, considering that there is absolutely no load on the server.
So I'm trying to find out where the overhead between ASP and the connection
to the SQL Server is. To eliminate IIS I wrote a test .vbs script and
executed it from the command prompt - it's slow also. There I saw that
executing the query seems to take so long.
Originally the page was accessing the data through ODBC, suspecting that
this might be a problem I changed it to sqloledb. Unfortunately it does not
seem to make a difference (tried named pipes and socket).
Another strange thing is that one of the queries is about twice as slow as
the other ones, even though it's of the exact same nature and it returns
superfast in the Query Analyzer. I also tried to access this view (the slow
one) from a remote computer with ODBC/MS Access and it's slow also.
Anyway, does anybody have an idea what's going on here? The code looks like
this:
strcon ="Provider=sqloledb;Data Source=dbserver;Network
Library=dbnmpntw;User ID=myuser;Password=mypwd;"
'strcon ="Provider=sqloledb;Data Source=127.0.0.1,1433;Network
Library=DBMSSOCN;User ID=myuser;Password=mypwd;"
Set Connection = CreateObject("adodb.connection")
Connection.ConnectionString = strcon
Connection.Open strcon
counter = 0
Set RS = Connection.Execute("select field1,total from view_distinct_field1
where field1 != '' order by total desc")
Do While Not RS.EOF
WScript.Echo RS.Fields("field1")
If counter >= Max Then
Exit Do
End If
counter = counter + 1
RS.MoveNext
Loop
This query is basically repeated 5 times, every time with a different field.
The counter is there so that only a maximum of X rows are returned.
The original way of connecting was:
Set Connection = CreateObject("ADODB.Connection")
ConnectionString = "DSN=" & SQLODBC
If (Len(SQLUser) > 0) Then
ConnectionString = ConnectionString & "; UID=" & SQLUser & "; PWD=" &
SQLPwd
End If
Connection.Open ConnectionString
For those curious, the machine is a P4 2.6GHz with 512Mb of RAM. There is
nothing on this server except for Win2k, IIS and SQL 2000. The machine is
pretty much idle, though there are clients connecting randomely and
inserting data into the table - I'd guess about 1 row every few seconds.
I just can't seem to understand what is delaying this stuff so much, I'll
continue my search with trying maybe PERL or something. What is the SQL
Analyzer doing better than all the other apps?
Thanks for any hints.
- Next message: Jeff Cochran: "Re: ASP/SQL Query Build - Myth Breaking"
- Previous message: Laphan: "ASP/SQL Query Build - Myth Breaking"
- Next in thread: Bob Barrows: "Re: iis/asp + sql2000 a bit slow"
- Reply: Bob Barrows: "Re: iis/asp + sql2000 a bit slow"
- Reply: Aaron Bertrand [MVP]: "Re: iis/asp + sql2000 a bit slow"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|