Asp. NET Performance Best Practices

Source: Internet
Author: User
Tags sql client web services client
Asp.net| Performance

According to MSDN Webcast collation
Logical/Physical Design practice
Recommendation: Use a logical three-tier model
Page (. aspx) and user control (. ASCs)
The reusable type (component) is placed in the \ Bin directory
The data is placed in the SQL database
Recommendation: Design for Web farm
Do not assume that visitors will never return to the same server
Note Static variables and application state
WEB Farm Session State
Recommendation: Use the same process
should be avoided (when possible):
Synchronous calls to XML Web services
Remote invocation via DCOM
To use an XML Web service:
Communication between applications on the Internet
Do not use in-use communication
Recommended: Use ISA Server when a DMZ security domain is required:
Only allow access through ISA
Isa tunnel arrives at ASP.net through the DMZ
Reduce process Conversions
Language/Code Suggestions
Avoid using late binding
<%@ Page Language = "VB" Explicit = "true"%> requires declaring all variable types, still allowing late binding
<%@ Page Language = "VB" strict = "true"%> prohibit the use of any late binding
COM Interaction Recommendations
Use COM as little as possible while using managed components
Data recommendations
storing data in SQL Server
Choose the right way to access the data: Oledb/sql CLIENT/ODBC
Reasonable selection of DataSet and DataReader for data access
State management
Choose the right way to store session:inproc/stateserver/database
Using simple data types
Avoid saving the STA's COM object in session
If session is not required, disable it: EnableSessionState = "false"
If possible, you can use the Readonly feature: EnableSessionState = "Readonly"
Which fruit does not need viewstate to disable it, EnableViewState = False
Minimizing data in ViewState
View the size of the ViewState view HTML output source or enable trace
Using caching
Page Caching
Partial page Caching
Cache Object
Data caching
WebService Cache
Ways to quantify Web performance: Machine throughput response times are tested by loading the server
Load using multiple client machines
Free Microsoft WEB Application Stress
Test multiple scenarios
Simulate end-to-end scene traversal of a site
Test Single page performance
The number that needs to be calculated
Request/sex under different loads (100,250,500,750,1000 and other simultaneous clients)
Identify the maximum customer load in acceptable ttfb/ttlb response times
Key Performance Counters
Processor, cpu% use rate | | Low value = Competitive by yin or lock
asp.net, row request number | | Linear growth means the server is full load
Asp. NET application, number of requests per second | | Dynamic throughput (should be consistent)
Asp. NET application, total error number | | Indicates a functional error (should be 0)
Asp. NET application, work process Restart | | Indicates a critical feature error



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.