Friday, June 4, 2010

Optimizing ASP .NET web application (brief checklist)


Optimizing ASP .NET web application (brief checklist)

1-      Performance Monitor
a.       Add Counters such as ASP .NET set of counters
b.      Requests per session
2-      Key Design considerations
a.       Design with performance in mind
b.      Consider security and performance
c.       Consider n-tier architecture
d.      Use caching (Enterprise library caching application block, ASP .NET caching)
3-      Minimize  database connections
a.       Use built-in connection pooling
b.      Store one connection string in web.config

4-      Turn off view state
5-      Usage of Session state
a.       In-proc  session state: Most efficient
b.      Session state server
c.       SQL session state
6-      Compile with release
Set debug to “false”

Set debug=false> in production, in root webconfig or machine config
You can also use below configuration to override anywhere that set’s :

in configuration
    system.web
          deployment retail=”true”
    system.web
configuration


7-      Use NGen
8-      Use Server.Transfer rather than Response.Redirect


SQL  Server performance tuning

1-      Set proper table indexes
a.       Use SQL profiler index Tuning Wizard
b.      Use SQL query analyzer to check execution plans
2-      Write good queries
a.       Use stored procs. not ad hoc SQL , (parameterized ad-hoc queries are also okay but when you can’t do the job with a proc)
b.      Avoid Distinct, and non-index where clauses
c.       Return only what you need  (avoid select * …)
3-      Performance Monitoring and logging
a.       Create permon logs