ASP. NET performance best practices

Source: Internet
Author: User
Tags sql client
Sort by msdn webcast

  • Logical/physical design practices
  • Recommendation: Use a logical three-tier model
      1. Page (. aspx) and user control (. ASCs)
      2. Reusable types (components) are placed in the \ bin directory
      3. Store data in SQL database
    Recommendation: designed for Web farm
      1. Do not assume that the visitor will always return to the same server
      2. Pay attention to static variables and application status
      3. Web farm session Status
    Recommendation: use the same process
    Avoid (when possible ):
      1. Synchronous calls to XML Web Services
      2. Remote Call through DCOM
    Use XML Web Services:
      1. Communication between applications on the Internet
      2. Do not use for intra-Application Communication
    Recommendation: use an ISA Server. When a DMZ security domain is required:
      1. Only access through ISA is allowed
      2. ISA tunnel reaches ASP. NET through DMZ
      3. Reduce process Conversion
  • Language/CodeSuggestions
      1. Avoid late binding
        1. <% @ Page Language = "VB" Explicit = "true" %> declare all variable types and allow late binding
        2. <% @ Page Language = "VB" strict = "true" %> Any late binding is prohibited.
  • Com interaction suggestions
      1. Use managed components instead of COM
  • Data recommendations
      1. Store data in SQL Server
      2. Select an appropriate data access method: oledb/SQL client/ODBC
      3. Properly Select dataset and datareader for data access
  • Status Management
      1. Select an appropriate method to store sessions: inproc/StateServer/Database
      2. Use simple data types
      3. Avoid saving the Stas COM object in the session.
      4. If you do not need a session, disable it: enablesessionstate = "false"
      5. If possible, you can use the readonly feature: enablesessionstate = "readonly"
      6. If viewstate is not required, disable it. enableviewstate = false
      7. Minimize data in viewstate
      8. View viewstate size view HTML output source code or enable trace
  • Use Cache
      1. Page Cache
      2. Partial page Cache
      3. Cache object
      4. Data Cache
      5. WebService Cache

    How to quantify web performance:
    Machine Throughput
    Response time
    Test by adding load to the server

  • Load with multiple client machines
  • Free Microsoft Web application Stress
  • Test multiple scenarios
      1. Simulate end-to-end scenario traversal of the site
      2. Test single-page performance
  • Value to be calculated
      1. Request/sex under different loads (100,250,500,750,100 0 and other clients simultaneously accessing)
      2. Identify the maximum customer load within the acceptable response time of ttfb/TTLB

    Key performance counters

  • CPU, CPU % usage | low value = overcast or locked
  • ASP. NET, number of incoming column requests | linear growth means the server is fully loaded
  • ASP. NET applications, requests per second | dynamic throughput (Consistent)
  • ASP. NET application, total error count | indicates a function error (it should be 0)
  • ASP. NET application, Working Process restart | indicates a serious function 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.