views:

127

answers:

5

Hi, I have deployed an application written in ASP.NET 2.0 into production and it's experiencing some latency issues. Pages are taking about 4-5 seconds to load. GridView refreshing are taking around the same time to load.

The app runs fine on the develpment box. I did the following investigation on the server

  1. Checked the available memory ... 80% used.
  2. Cheched the processor ... 1%
  3. Checked disk IO from perfmon, less than 15%

The server config is

Windows Server 2003 Sp2 Dual 2.0 GZH 2GB RAM

Running SQL Server 2005 and IIS only

Is there anything else I can troubleshoot? I also checked the event log for errors, it's clean.

EDITED ~ The only difference I just picked up is on the DEV box I am using IE7 and the clients are using IE6 - Could this be an issue?

UPDATE ~ I updated all clients to IE8 and noticed a 30% increase in the performance. I finally found out I left my debug=true in the web.config file. Setting that to flase got the app back to the stable performance... I still can't believe I did that.

A: 

Are you running against the same SQL Server as in your tests or a different one?

In order to find out where the time's coming from you could add some trace statements to your page load, and then load the page with tracing turned on. That might help point to the problem.

Also, what are the specs of your development box? The same?

Simon Steele
No different databse server. I copied the database from development to production. The specs are almost same, 1 GB more ram on the development box.
Saif Khan
Does this mean you have a production sql box with only 1GB of RAM?
Chris Lively
+1  A: 

Also check your page size. A developer friend of mine once loaded an entire table into viewstate. A 12 megabyte page will slip by when developing on your local machine, but becomes immediately noticeable in production.

Mike Robinson
how do I check this?
Saif Khan
Download Firebug AND YSlow (in that order, firefox only). YSlow will give you a full analysis of your page.
Mike Robinson
+2  A: 

First thing I would do is enable tracing. (see: http://www.4guysfromrolla.com/webtech/081501-1.shtml)

then add tracing points to your page generation code to give you an idea of how long each part of the page build takes:

System.Diagnostics.Trace.Write(
                "Starting Page init",
                "TraceCheck");
//Init page

System.Diagnostics.Trace.Write(
                "End Page init",
                "TraceCheck");

System.Diagnostics.Trace.Write(
                "Starting Data Fetch",
                "TraceCheck");
//Get Data

System.Diagnostics.Trace.Write(
                "End Data Fetch",
                "TraceCheck");

etc

this way you can see exactly how long each stage is taking and then target that area.

Richard
Thanks. I'll give this a shot.
Saif Khan
A: 

Depending on the version of visual studio you have, Team Developer has a Performance Wizard you might want to investigate.

Also, if you use IE 8, it has a Profiler which will let you see how long the site takes to load in the browser itself. One of the first things to determine is whether the time is client side or server side.

If client side, start looking at what javascript you have and optimize / get rid of it.

If server side, you need to look at all of the performance counters (perfmon). For example, we had an app that crawled on the production servers due to a tremendous amount of JIT going on.

You also need to look at the communication between the web and database server. How long are queries taking? Are the boxes thrashing the disk drives? etc.

Chris Lively
+1  A: 

Double check that you application is not running in debug mode. In your web.config file check that the debug attribute under system.web\compilation is set to false.

Besides making the application run slower and using more system memory you will also experience slow page loading since noting is cached when in debug mode.

Y Low
This was exactly my freaking oversight! I can't believe I made such as silly mistake, seriously!
Saif Khan