"Large Web site Technology architecture: Core Principles and Case studies" note 03

Source: Internet
Author: User
Tags browser cache website performance

"Large Web site Technology architecture: Core Principles and Case studies" Note 01

1. Core architectural elements of a large web site.

Architecture: "The highest level of planning, difficult to change the decision." "From this perspective, life planning is also an architecture. Choose what school, study what profession, enter what company, find what object, live what kind of life, all is the structure of own life.

Software Architecture: "An abstract description of the overall architecture and components of the software to guide the design of large software systems in all aspects." ”

Five key elements: performance, availability, scalability, scalability, and security.

2. Performance Test Indicators:

Response time: The time it takes for an app to perform an action, including the time it takes to start the request to receive the response data at the end.

Concurrency: Refers to the number of requests that the system can process simultaneously, and this number also reflects the load characteristics of the system.

Throughput: Refers to the number of requests processed per unit of time, reflecting the overall processing capacity of the system. (Quantitative indicator TPS: Number of transactions per second)

Performance counters: Some data metrics that describe the performance of a server or operational system . This includes metrics such as system load, number of objects and threads, memory usage, CPU usage, disk and network I/O.

3. Performance test methods: Performance test, load test, stress test and stability test.

4. Performance optimization

4.1 Web front End performance optimization

4.1.1 Browser Access Optimization

(1) Reduce the HTTP request: The HTTP protocol is a stateless application layer protocol, which means that each HTTP request needs to establish a communication link, data transmission, and on the server side, each HTTP needs to start a separate thread to handle. These communications and services are expensive, and reducing the number of HTTP requests can effectively improve access performance. (Workaround: JavaScript, CSS merged into a single file, multiple images merged into one)

(2) Use browser cache: Cache the static resource files such as CSS, JavaScript, logo and icon with low update frequency in the browser. When updating, change the file name to generate a new JS file and update the references in the HTML file. Batch update should be the file at a certain time interval after the update, so that the user's browser suddenly a large number of cache failure and centralized update cache caused the server load surges.

(3) Enable compression: In the browser side of the file decompression, effectively reduce the amount of data transmitted by the communication.

(4) CSS is placed at the top of the page, JavaScript is placed at the bottom of the page: the page loads all the CSS and then displays, the JavaScript executes immediately, and when the page parsing does not need JavaScript, put JavaScript on the base.

(5) Reduce cookie transmission: Careful consideration when data is written to cookies; static resources use independent domain name access to reduce the number of cookie transfers.

4.1.2 CDN Acceleration

Deploying a CDN in the computer room of a network operator (Network service provider) is essentially still a cache, where the data cache (static resources) is closest to the user.

4.1.3 Reverse Proxy

  

4.2 Application Server Performance optimizations

1. Distributed cache

Website performance Optimization First Law: Limited consider using caching to optimize performance.

2. Asynchronous operations

Asynchronous processing: Anything that can be done later should be done later.

3. Using the cluster

4. Code optimization

Multithreading, resource reuse, data structures, garbage collection

4.3 Storage performance optimization

Mechanical disk Characteristics: Fast sequential read/write, slow random Read and write

SSD features: Data is stored on a long-lasting memory silicon crystal for fast random access

B + tree (mechanical hdd) LSM tree (NoSQL product)

Developed by RAID support to HDFs (Hadoop Distributed File system) with MapReduce

"Large Web site Technology architecture: Core Principles and Case studies" note 03

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.