Solved

why is my ASP.NET 4 site slow?

Posted on 2010-08-29
11
760 Views
Last Modified: 2012-05-10
I have a core 2 duo T7400 with 4GB RAM, windows 2003 server with sql server 2005 and the site is running in ASP.NET 4
The CPU is only at 10%, but the site is very unresponsive, the database have indexes on all queried fields.
When I had under 1000 records the response was almost instant, now with 60k records some queries takes forever.

What can I do to improve the performance of the site?

the site is http://www.mobivel.com
0
Comment
Question by:evo_x
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 21

Expert Comment

by:Dale Burrell
ID: 33555368
For each database call trace the start and end times so you can see where the time is being taken. Then assuming it is a query use the query optimiser to sort it.
0
 
LVL 2

Author Comment

by:evo_x
ID: 33555378
What is strange that sometimes the same query returns in 2-3 seconds and after an hour it takes more than 30 seconds and I get a timeout.
The site does not have heavy traffic, 50-100 visits / day.

How do you mean to trace? from sql server or from the web app ?
0
 
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 33555381
which queries are slow?
we can focus on slowest page/query...
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 33555386
is the site compiled on web server? or you have just code and each time server builds it?
0
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 250 total points
ID: 33555392
web.app log... I do the following on all my sites:

            if (Trace != null && Trace.IsEnabled) Trace.Warn("Database", Query);
            // Run query
            if (Trace != null && Trace.IsEnabled) Trace.Warn("Database", "Query End");

then it will turn up in the page trace i.e. website/trace.axd and it shows how long each query took, as well as the regular stuff like how long each control takes to load etc.
0
 
LVL 12

Assisted Solution

by:UnexplainedWays
UnexplainedWays earned 250 total points
ID: 33555394
Have you checked your viewstate lately?

View the source and look for <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"  and check the length of it.

http://msdn.microsoft.com/en-us/library/ms972976.aspx


What you need to do is find any control that doesn't need to maintain its state and disable the view state.  Otherwise the first visit to the page, .net needs to save stuff in that view state, then when you press a button, that has to get sent back to the server where .net pulls it apart then does its .net stuff and then resaves it all.

It might not be the cause of the entire site, but it will help.
0
 
LVL 2

Author Comment

by:evo_x
ID: 33562897
HainKurt, the website is compiled in visual studio each time and then uploaded to server. It is slow expecially whn you click on a category which has many records, ex. Honda, but it's not slow always, sometimes it's fast and sometimes it takes forever to return.

dale burrell: I will try that trace.
UnexplainedWays: I think the viewstate might be a cause...I will check that out.

Thanks all ! I will do some checks and come back.
0
 
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 33564032
when you run that query against db from ssms, is it always fast or sometimes slow?
0
 
LVL 2

Author Comment

by:evo_x
ID: 33573291
in ssms it's fast always.
0
 
LVL 2

Author Comment

by:evo_x
ID: 33573347
dale_burrell: How can I activate the trace? because the trace.axd file is not created.
0
 
LVL 21

Expert Comment

by:Dale Burrell
ID: 33573960
trace.axd isn't a real file... its intercepted by the asp.net handler. Anyway for the full story check this out http://msdn.microsoft.com/en-us/library/bb386420.aspx
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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