Best Practices to Improve ASP.Net Web Application Performance.

  • [font="Arial Narrow"]Best Practices to Improve ASP.Net Web Application Performance.[/font]

    Performance tuning can be tricky. It's especially tough in Internet-related projects with lots of components running around, like HTML client, HTTP network, Web server, middle-tier components, database components, resource-management components, TCP/IP networks, and database servers. Performance tuning depends on a lot of parameters and sometimes, by changing a single parameter, performance can increase drastically

    Introduction

    This article lists out some tips for optimizing ASP.Net Web applications and many traps and pitfalls are discussed as follows:

    Tips For Web Application

    1) Turn off Tracing unless until required Tracing is one of the wonderful features which enable us to track the application's trace and the sequences. However, again it is useful only for developers and you can set this to "false" unless you require to monitor the trace logging.

    How it affects performance:

    Enabling tracing adds performance overhead and might expose private information, so it should be enabled only while an application is being actively analyzed.

    Solution:

    When not needed, tracing can be turned off using

    2) Turn off Session State, if not required

    One extremely powerful feature of ASP.NET is its ability to store session state for users, such as a shopping cart on an e-commerce site or a browser history.

    How it affects performance:

    Since ASP.NET Manages session state by default, you pay the cost in memory even if you don't use it. I.e. whether you store your data in in-process or on state server or in a Sql Database, session state requires memory and it's also time consuming when you store or retrieve data from it.

    Solution:

    You may not require session state when your pages are static or when you do not need to store information captured in the page. In such cases where you need not use session state, disable it on your web form using the directive,

    3) Disable View State of a Page if possible

    View state is a fancy name for ASP.NET storing some state data in a hidden input field inside the generated page. When the page is posted back to the server, the server can parse, validate, and apply this view state data back to the page's tree of controls. View state is a very powerful capability since it allows state to be persisted with the client and it requires no cookies or server memory to save this state. Many ASP.NET server controls use view state to persist settings made during interactions with elements on the page, for example, saving the current page that is being displayed when paging through data.

    How it affects performance:

    There are a number of drawbacks to the use of view state, however. It increases the total payload of the page both when served and when requested. There is also an additional overhead incurred when serializing or deserializing view state data that is posted back to the server. View state increases the memory allocations on the server. Several server controls, the most well known of which is the DataGrid, tend to make excessive use of view state, even in cases where it is not needed.

    Solution:

    Pages that do not have any server postback events can have the view state turned off. The default behavior of the ViewState property is enabled, but if you don't need it, you can turn it off at the control or page level. Within a control, simply set the EnableViewState property to false, or set it globally within the page using this setting: If you turn view state off for a page or control, make sure you thoroughly test your pages to verify that they continue to function correctly.

  • I'm sorry but I've got to ask what you're trying to say here and what relevance it has to SQL Server, all of the tips in your posting are application/IIS tweaks?

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply