ASP. NET performance transcript zz

Source: Internet
Author: User

Performance optimization is not performed after project development, but a problem that is considered during preliminary design.

1. Performance Evaluation
(1) Client response time (TTLB-TTFB); network bandwidth and web program factors. Generally, it cannot exceed 8 secends;
(2) server throughput (processing requests/s ).

2 Evaluation Method-Stress Testing Stress Test
Tools-Web Application Stress Tool
Http://www.microsoft.com/techent/treeview/default.asp? Url =/technet/itsolutions/intranet/downloads/webstres. asp
ACT (VS. NET Enterprise Tools)

3. Performance Considerations
(1) CPU usage;
(2) Request In Application Queue Request cache queuing. If linear growth occurs, the server reaches full load;
(3) Request/Sec;
(4) ErrorsTotal (should = 0 );

4 stress test notes
(1) run the test tool independently of the web server;
(2) simulate different client bandwidth levels;
(3) Eliminate any bottlenecks other than applications (such as networks ).

5. Logic DesignSuggestion: layer-3 Model
Page (. aspx) and User Controls (. ascx) UI
Business and Data Access classes in \ bin dir
Data within a SQL Database via SPROCs

6. DataReader VS DataSet
(1) DataReader: one-way reading; lightweight and fast;
(2) DataSet: non-connected data access; internal use of DataReader to read data; closed automatically after reading;
(3) On average, a datareader is 16% faster than DataSet.

7 connection pool
(1) Automatic Cache/reuse of connections;
(2) Open the connection as soon as possible and close it as soon as possible;
(3) Different connection strings are considered as different connection pools;
(4) store a single connection string in web. config and then read it;

8. Use stored procedures
(1) DBA can debug performance more easily;
(2) Prevent SQL injection attacks;
(3) Disable dynamic SQL support in the Enterprise Manager and use the Stored Procedure forcibly;

9 Key Points of Server Control Performance Optimization
(1) ViewState
(2) Number of controls generated (especially for lists)

10 ViewState Management
(1) ASP. NET controls can maintain the status of the page Control element;
(2) When the page is PostBack, The ViewState will be submitted;
(3) benefits: The entered information can be displayed again, and some data bindings do not need to be extracted from the database again;
(4) negative: increases network load and server performance consumption;

11 Using Cache Technology
OutputCaches

12. Performance Configuration
Debug = "false"

 

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.