Saif Khan
Saif Khan

Reputation: 18792

ASP.NET Application Deployment Issue

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.

Upvotes: 0

Views: 301

Answers (5)

Yona
Yona

Reputation: 9682

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.

Upvotes: 1

ChrisLively
ChrisLively

Reputation: 88064

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.

Upvotes: 0

Richard
Richard

Reputation: 22016

First thing I would do is enable tracing. (see: https://web.archive.org/web/20210324184141/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.

Upvotes: 2

Mike Robinson
Mike Robinson

Reputation: 25159

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.

Upvotes: 1

Simon Steele
Simon Steele

Reputation: 11608

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?

Upvotes: 0

Related Questions