• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

EXTREMELY SLOW WEB - SQL

Hi there, I am having the following problem:

My web page, built in ASP.NET with VB.NET running against a SQLServer 2000 is running extrmely slow.

The app is hosted in 2 servers. Both of them are experiencing the same problem. The internet connection is aldso shared with other servers, which are running OK. Therefore I discarded a saturation of the connectio.

I imagined it was the database, but when running queries outside of the app, the server responds reasonably well. It might be a little slower than what it was  when running OK but seems not big deal. I once had problems with the DB and the result was getting "Time Out" messages, which isnt happening now.  So i am not sure if it is the database.

Anyway, whenever I run any page, it takes more than 45sec-1min to get results (it used to be 5 secs max)
Anyone have any clue what it may be?

Thank You
0
howtodoit
Asked:
howtodoit
  • 8
  • 7
1 Solution
 
AGBrownCommented:
Have you monitored the queries directly using SQL Profiler to see how long they are running for?

Andy
0
 
AGBrownCommented:
Oh, and while we're at it, have you tried enabling tracing in your web.config to get an idea of possible problems? You say you are using SQL server 2000, does that mean you are using .NET 1.1? If you are using .NET 1.1 you put Trace="true" in your @Page directive at the top of the page, if you are using .NET 2.0 you can put:

<trace enabled="true" requestLimit="1000" pageOutput="true" traceMode="SortByTime" localOnly="true"/>

in your web.config file.

The trace outputs the time taken to process the various stages of the page process. E.g. (for .NET 1.1):
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin Init  
aspx.page End Init 0.014024 0.014024
aspx.page Begin PreRender 15.968093 15.954069
aspx.page End PreRender 15.970228 0.002135
aspx.page Begin SaveViewState 15.978351 0.008124
aspx.page End SaveViewState 15.988359 0.010008
aspx.page Begin Render 15.988416 0.000057
aspx.page End Render 16.153444 0.165027
0
 
howtodoitAuthor Commented:
AGBRown

I have just enabled trace. I was using the 1.1 and upgraded some time ago. I found precisely what you wrote, so I guess I am using 2.0.

Where would the trace output be?  In which directory?
Ye I have tried running the profiler, i am trying to see what the profiler says against wht the asp says.
Regards
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
AGBrownCommented:
On both .NET 1.1 and 2.0, trace output can be viewed either using Trace.axd from the root url of the application (e.g. http://mydomain.com/myapp/trace.axd), or in the page itself at the bottom of the page. Actually I just checked my old .NET 1.1 applications and they both let you enable tracing for the whole application through the web.config using the code I pasted above, so if you ensure that pageOutput="true" in the web.config you will see the trace output at the base of the page.

I'm glad you're running SQL profiler as well, depending on how you are connecting to your database, queries can run differently if you start them from query analyzer or a .NET application.

Andy
0
 
howtodoitAuthor Commented:
AGBrown, let me show you what the debug threw me.


aspx.page Begin Init  
aspx.page End Init 0.000050 0.000050
aspx.page Begin LoadViewState 0.000075 0.000025
aspx.page End LoadViewState 0.001605 0.001530
aspx.page Begin ProcessPostData 0.001629 0.000023
aspx.page End ProcessPostData 0.001783 0.000154
aspx.page Begin ProcessPostData Second Try 0.001824 0.000041
aspx.page End ProcessPostData Second Try 0.001843 0.000019
aspx.page Begin Raise ChangedEvents 0.001872 0.000029
aspx.page End Raise ChangedEvents 0.001892 0.000020
aspx.page Begin Raise PostBackEvent 0.001911 0.000019
aspx.page End Raise PostBackEvent 0.016930 0.015019
aspx.page Begin PreRender 0.016960 0.000030
aspx.page End PreRender 0.017029 0.000069
aspx.page Begin SaveViewState 0.023453 0.006424
aspx.page End SaveViewState 0.023727 0.000274
aspx.page Begin Render 0.023748 0.000021
aspx.page End Render 0.029211 0.005464

On the Control Tree

    form1 System.Web.UI.HtmlControls.HtmlForm 51381 0
        _ctl1 System.Web.UI.LiteralControl 5 0
        txtSLName System.Web.UI.WebControls.TextBox 193 0

       TxtRAddr System.Web.UI.WebControls.TextBox 193 40
        cboCountryto System.Web.UI.WebControls.DropDownList 2049 1516
        cboCities System.Web.UI.WebControls.DropDownList 257 0

        DBGInfo System.Web.UI.WebControls.DataGrid 1401 440
            DBGInfo:_ctl0 System.Web.UI.WebControls.DataGridTable 1401 0
                DBGInfo:_ctl1 System.Web.UI.WebControls.DataGridItem 228 0

        DBGInfo System.Web.UI.WebControls.DataGrid 1401 440
            DBGInfo:_ctl0 System.Web.UI.WebControls.DataGridTable 1401 0
                DBGInfo:_ctl1 System.Web.UI.WebControls.DataGridItem 228 0
 

I extracted what seemed to me the most important
0
 
AGBrownCommented:
That would suggest that your page completed its server-side processing (from request received, to running the query, to rendering the html for the client) in 0.029211 seconds.

How long did that page take to load on the client? If it took 45 seconds then it would suggest that the problem is elsewhere in the pipeline.

A
0
 
howtodoitAuthor Commented:
By the way, can you tell me what this is?
HTTP_X_FORWARDED_FOR

What do you think of what I just sent you?
Regards
0
 
howtodoitAuthor Commented:
That would mean from the SERVER OUT to the client, right?
0
 
howtodoitAuthor Commented:
Let me tell you what I tried just now

I run the page checking all times involved

From button pressed to return control to user on the client :     17 seconds
Processing of the page according to the trace:                         0,009139
Run a tracert from that server to the ip where I am now:          <54 ms

I have lost somewhere 16 seconds. Any suggestions how I can trace this better?
0
 
kraffayCommented:
Make sure your web.config has debug=false
0
 
AGBrownCommented:
My next step would be to use IIS's logging feature to see what time it records the request, and how long it says it is taking to process it. If it also says 0.009 seconds, then the problem is external to the IIS pipeline, i.e. on the browser-> IIS part.
0
 
AGBrownCommented:
But the good news is that it isn't your database query that's slowing it down ;)
0
 
howtodoitAuthor Commented:
AG You have helped me a lot so far and the points are well deserved, so i am assgning them for this question already.
I would like to go on with your help. I will probably post in a couple of hours a new question to follow on the "tracing" of this problem.
Thank you
0
 
AGBrownCommented:
No problem, thank you for the points. Its pretty late here now, so if you leave a pointer to your next question from here then I'll take a look tomorrow.

Andy
0
 
howtodoitAuthor Commented:
Hi AG, I have posted the new question under the "web development" area with the following title:
"trouble communicating through internet "
I tried to see the log of the iis, but i can only see there one time , how can i see the time it took to resond?
Regards
0
 
AGBrownCommented:
(Next question reference http:Q_22065806.html)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now