(If this is the wrong forum, please advise and I'll repost).
I have developed a web site, www.nzgdb.co.nz, using Visual Web Designer 2005 (Express). It has a large genealogy database (SQL Server 2005), and runs on a new dual-core processor server with 2GB of memory, using SBS 2003 (SP 2). There are no other applications or web sites running on this server.
My design is supposed to be optimized for the two critical activities, page GDB1 which searches the GDB (genealogy database) according to various criteria to return a list of records, and page GDB2 which is invoked to display one of these records. My own experience had been of usually getting 1-3 second responses for these activities, and the occasional exceptions were explainable. However recently I received some complaints, so I started to investigate. I reasoned that the overall process was something like this: -
1. The user enters his search criteria and clicks the [Search] Button. This causes a request to be sent through the internet that eventually results in page GDB1 on my server being invoked to process the request.
2. Page GDB1 starts up the code that I have written, which does its thing with various logic, including database lookups etc, until it has a response ready, then
3. The response is sent back.
The user would observe the total time for steps 1 to 3, but any problems would most likely be in my code, so I instrumented pages GDB1 and GDB2 with: -
Dim Starttime As DateTime
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Starttime = Now()
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
Dim Interval As TimeSpan = Now() - Starttime
log.WriteApplog("Time taken =" & Interval.ToString, "GDB1")
log.WriteApplog writes a timestamped record to an "application log" table in the database. By capturing the time interval from the very first thing that the page did to the very last I expected to capture the bulk of the time taken, and all of the time that was easily under my control. I expected that little time would be spend in steps 1 and 3 above, and that the logged time would be comparable (say 1 or 2 seconds less) than the stopwatch-measured time at the client (my laptop). I ran some experiments: at the time that I ran them I was the only user on the system, so issues of concurrency/interference don't apply.
Surprise: according to the application log, typical times are a few tenths of a second. Yet I observed much longer times: -
A search: the log reported "Time taken =00:00:00.1718783", I observed 6 seconds
Displaying a record. Page GDB1 reported "Time taken =00:00:00.0156253" to respond to the click and execute the Response.Redirect, and page GDB2 reported "Time taken =00:00:00.1406277" to display the record, so total time = 0.156253 plus the minute amount of time for the Response.Redirect. Yet I observed 40 seconds!
1. Am I correct in assuming that there is no point in looking for performance problems in the database or code design because the logged timespans show that this is already performing adequately?
2. Would it make any significant difference to carefully review Viewstate, and avoid using it where possible? I have simply accepted the VWD defaults, which is to put everything into Viewstate.
3. The database is now very big, just under 6GB. Could I have a memory/paging problem? If so, how do I find out? SBS has various counter logs for performance monitoring, but none are turned on at the moment: which should I turn on?
3. Help. Questions 2 and 3 could be asking the wrong questions - where do I start?
Check out this posting from last week. Lots of performance tips:
Thanks for this, it looks an excellent article. I'll work through it and apply the tips that I can, and see what difference it makes.
This might be helpful
Mark as answer if the post meets your requirement!
I struck a problem: ASP.Net Pipeline Optimization (Page 2). The paper suggests removing unwanted modules by adding something like this to web.config: -
<!-- Remove unnecessary modules for faster pipeline. Refer http://forums.asp.net/p/1216975/2160615.aspx#2160615 -->
Naturally I want to check this out in test, so I added this to the web.config for the test server (Visual Web Developer 2005 Express). My application then wouldn't compile, with message
(Description File Line)
Unrecognized configuration section httpModules. C:\Documents and Settings\Robertb.ROBERTB\My Documents\Visual Studio 2005\WebSites\GDB2\web.config 3
What am I doing wrong? Should this be within some other section (this is not mentioned in the paper). Or is this not supported for the test server?
Sorted. What the article didn't say is that <httpModules>... should be within the <system.web>... section.