Speeding up Web Apps

Posted on 2006-06-21
Last Modified: 2008-03-03
Hi Guys,

I have a c# .net web application using IIS6, SQL2005, MapXtreme and (ASP front end).

It is running extremely slow.  I have optimised my code as much as possible, I have put IIS on the same machine as SQL Server and i have installed extra network cards into the Web server / SQL server and created a MAC Bridge.

I can't give too many details on the application as it is a work project and there are confidentiality issues.  Does anyone know or have any suggestions as to what i can do in order to try and find out:

A) why it is running so slow

B) what i can do to speed it up.

Bearing in mind i cannot give out much more detail than this, I am making it worth 500 points for whoever can give advice, suggestions, hints or tips in order for me to speed the thing up
Question by:NAORC
  • 4
  • 3
  • 2
  • +2

Author Comment

ID: 16951388
Dont know whether or not it makes a difference, but a select few machines have fast responce times and the app works fine, but on most its real slow.  I have looked at too many settings to name and had no joy..

Expert Comment

ID: 16951819
A sure fire way to speed up an ASP app that is sluggish is to implement page caching.  This feature of is very helpful and very customizable.

Good luck.

Expert Comment

ID: 16952145
i think reading large nb of data from databases slowes a lot ur application. u can apply Maintenance Plan to ur db. it might help.
also try to optimize ur queries.
also try to use as much as u can client side scripts as vbscripts, javascripts to minimize going to the server.

that s the most i can tell u since  i dont know execlty what ur app do.

good luck


Accepted Solution

lostcarpark earned 500 total points
ID: 16952528
Hmmm, this sounds familiar. Do you have a lot of viewstate information in your app? You can find out by using the "View Source" command in your browser. There will be a block of binary data near the top of your page source. If there is more than a couple of lines of data, it can seriously affect performance, particularly on slower networks.

I have an app with a lot of UserControls that are hidden when not required, and I ran into a very similar problem. The solution I found was to move the viewstate from the client to the server and store it in the Session. This can be achieved quite neatly by changing the base class of your pages to one that inherits from the standard one, but replaces the methods that save and retrieve the viewstate with ones that sasve to the Session.

You can find more about this here:

Hope this is helpful to you.


Author Comment

ID: 16952709

Yeah, i think thats quite a bit....
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.


Expert Comment

ID: 16952763
It is quite large but not abnormally large.

I'd give some other things a try before implementing a custom view state for your app.  

Expert Comment

ID: 16952773
A good way to test would be perform some similar logic on a code behind without adding any controls on your ASPX page.  This will keep the View State small and also allow you to run your logic and do a latency test.

Expert Comment

ID: 16954610
In my opinion your viewstate is tiny. That is definitely not the issue.

First you need to find out where the app is running slow. Is it the code? Are your SQL queries slowing down the website?

Create a couple of static html pages and see how fast they load.

Also you could use SQL Server profiler to monitor the activity between your app and the database server. See if any queries are taking too long to execute.

Use stored procedures if you are not already doing so.

Create some indexes to optimize your queries.

In the web.config file disable debug.

Make sure your select queries return only the columns your are actually using.

How is you CPU usage when the app is running.
Is it nearly 100% and if yes check to see which processes are using that much cpu and also check your memory usage.

Check the memory usage when the app is running.

Do some timing on you code blocks and see how fast they execute.

I hope this helps.

Expert Comment

ID: 16956173
I agree that ViewState is not excessive (I wouldn't go so far as to say "tiny", but I've seen ones that run to several hundred K), so something else must be the issue. You mentioned that it runs okay on higher spec PCs, but the problem mainly occurs on older, slower machines. This would suggest that the problem is at least partly on the client side. Are you using any 3rd party controls that have a large JavaScript element? This would be relying quite heavily on the client PC and contributing to the problem.

Author Comment

ID: 16958823
All answers appreciated.  We are working on implimenting some answers now.  if and when one works, point will be awarded.  thanks in advance for patience experts, but this is a lot of code we need to work on.

Author Comment

ID: 17008752
Sorry guys, please bear with us... we've hit some dificulties.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now