Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
I have no idea where to begin on this one, so any help will be appreciated.

We have two websites, with almost identical content.

One, our currently live site, is very fast with very little perceptible lag between requesting a page and its delivery. It is running the .Net Framework 2.0 on Windows Server 2003 R2 SP2 64-bit with IIS 6.

The other, which will become our live site in a few months, exhibits a lag of 1 second to as long as 10 seconds when retrieving a page. It is running the .Net Framework 3.5 on Windows Server 2008 SP2 64-bit with IIS 7. It is a virtual machine, but otherwise has the same "hardware" as the old server: same memory, same drive storage, same number of processors, etc.

The reason for the new site is that we are adding some pages, removing some pages, reorganizing the folder hierarchy to remove some redundancy and clutter that has accumilated over the years, and given the site a new facelift by redesigning the CSS. By and large, though, the two sites are largely the same, with most pages identical (other than having different stylings) on both sites. This has allowed us to do side-by-side comparisons on the same desktop machine using the same browsers over the same network connection.

The problem is that the old site is consistently fast: click on a link, and the new content is loaded with very little perceptible lag. The new site is consistently slow: click on the same link, and the same browser on the same computer hangs as it waits for the same content to be delivered. This does not appear to be a database issue, as the lag on the new site is there whether the page being tested is static text or retrieves a lot of data from a complex query. For what it is worth, both sites pull data from the same database on the same database server.

I am inclined to suspect some kind of optimization of IIS, but the old website was set up by someone who is no longer with the company. At this point, I don't even know where to start poking. Anyone have any suggestions?
Posted

 
Share this answer
 
Comments
Gregory Gadow 10-Mar-11 20:54pm    
Excellent, thank you. I will look those over when I get back to the office tomorrow.
RaviRanjanKr 10-Mar-11 22:25pm    
Good Collections of Links. have a my 5 :)
Hello,

Before you start to modify anything, I would recommend to analyze what exactly creates those lags.
So in my opinion the best way to start would be to enable the ASP.NET Tracing where you see exactly which step will be executed and how long it takes to process.

Here you will find a description on how you enable the ASP.NET Tracing:
http://msdn.microsoft.com/en-us/library/0x5wc973.aspx[^]

and here you will find how you access the trace results:
http://msdn.microsoft.com/en-us/library/wwh16c6c.aspx[^]

As a short overview, you have to do the following tasks:

  • add the following trace element in the web.config of the application you want to trace:
    XML
    <configuration>
      <system.web>
        <trace enabled="true" pageOutput="false" requestLimit="40" localOnly="false"/>
      </system.web>
    </configuration>

  • Make a Request (or more than one request) to the page where you want to execute the tracing (just simply browse to that page)
  • open the website http://<domain>/<rootweb if applicable>/trace.axd and look at the requests done.


Please be aware of the fact that the enabled trace will slow down the site again, so turn the trace off again as soon as you do not need it anymore!

Hope this helps and that this sheds some light into the darkness.

Best regards and have a nice day,
Stops
 
Share this answer
 
Comments
Gregory Gadow 11-Mar-11 11:49am    
Ayup, you're running two for two. After enabling the trace, I found out that the problem was all in the rendering. Poking at the code behind the scenes indicated the GetUser method from my custom MembershipProvider. I will focus on getting that optimized and figuring out why it is so bloody slow on this one server. Thanks again.
Christoph Keller 14-Mar-11 3:36am    
You're welcome, glad to hear that I could help :)
Gregory Gadow 14-Mar-11 11:51am    
Follow up: Turning on tracing and using HttpContext.Trace.Write to output checkpoints showed that my custom GetUser function was getting called as much as 14 times (!!) every page call, not counting a DispatchLink control that retrieved user information and rendered according to permissions; some pages had dozens of DispatchLink controls. The fix was to cache the data rather than retrieving it each time. The control was rewritten to use that cache. The site is running much quicker, thanks again.
Christoph Keller 14-Mar-11 11:55am    
You're welcome!
It is really the best way to start looking at a performance problem, I think. :)
Same server?
Images called in the same way?
Style sheets similar?
Different ISP?

all sorts of things could cause it, more information would help.
 
Share this answer
 
Comments
Gregory Gadow 10-Mar-11 20:53pm    
The two sites are on different servers, and the styling is different. Images and page content are identical. Both sites are being accessed on the same desktop computer side by side. The lag occurs even when there is no database access, just serving up a static page.
I sat with the exact same problem when i began web development.

Biggest thing to look out for is in the web.config
The debug=true should be set to false.

Also on your page itself, if it does not need to be an asp control you should make it a default html control. ASP controls eats away bandwidth because it increases the size of your view-state(data beging send back and forth)

Also if you into advanced .ne coding consider using jquery and .ashx files to execute commands
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900