Solved

EXTREMELY SLOW WEB - SQL

Posted on 2006-11-18
16
380 Views
Last Modified: 2008-02-01
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
Comment
Question by:howtodoit
  • 8
  • 7
16 Comments
 
LVL 12

Expert Comment

by:AGBrown
ID: 17972524
Have you monitored the queries directly using SQL Profiler to see how long they are running for?

Andy
0
 
LVL 12

Expert Comment

by:AGBrown
ID: 17972540
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
 

Author Comment

by:howtodoit
ID: 17972591
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
 
LVL 12

Expert Comment

by:AGBrown
ID: 17972608
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
 

Author Comment

by:howtodoit
ID: 17972855
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
 
LVL 12

Accepted Solution

by:
AGBrown earned 500 total points
ID: 17972871
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
 

Author Comment

by:howtodoit
ID: 17972886
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
 

Author Comment

by:howtodoit
ID: 17972893
That would mean from the SERVER OUT to the client, right?
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:howtodoit
ID: 17972925
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
 
LVL 9

Expert Comment

by:kraffay
ID: 17973014
Make sure your web.config has debug=false
0
 
LVL 12

Expert Comment

by:AGBrown
ID: 17973047
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
 
LVL 12

Expert Comment

by:AGBrown
ID: 17973048
But the good news is that it isn't your database query that's slowing it down ;)
0
 

Author Comment

by:howtodoit
ID: 17973077
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
 
LVL 12

Expert Comment

by:AGBrown
ID: 17973099
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
 

Author Comment

by:howtodoit
ID: 17973892
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
 
LVL 12

Expert Comment

by:AGBrown
ID: 17976537
(Next question reference http:Q_22065806.html)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now