Build a high-performance web site

Source: Internet
Author: User

Here 's a summary of the first chapter of Guo, "building a high-performance Web site."

1. The truth of the waiting

a) during the time the user waits, the following parts of the time are likely to occur:

I. time the data travels over the network: includes two parts, the time that the browser-side host makes a request to reach the server through the network, and the time that the server responds to the network to reach the browser host. Also known as response time, his determinants mainly include the amount of data sent and the network bandwidth. When the site server processes requests and responds to data -

II. the time at which the site server processes requests and generates response data. Mainly consumed on the server side , including a lot of links, we generally use the "processing requests per second" metric to measure this part of the time, also known as the throughput rate: the number of requests processed per unit of time. There are many factors that affect the throughput rate, such as the concurrency policy of the server, I/O model,I/O performance,CPU core Count, And, of course, the logic complexity of the application itself.

III. the time of the browser's local calculation and rendering. Mainly consumed on the browser side. Dependency factors include the concurrency policy adopted by the browser, style rendering, script interpreter performance, page size, number of page components, page component cache status, page component domain name distribution, domain name DNS resolution, etc.

2. where are the bottlenecks ?

a) the bottleneck of the system is the key factor that affects the performance, and this factor will be changed or migrated as the system runs. If you really find the main factor in the performance of your imaging system, adjust and optimize it

3. Increase Bandwidth

4. reduce http requests in Web pages

a) design simpler web pages that contain fewer images and scripts, but may sacrifice aesthetics and user interaction

b) merging multiple images into a single file, using The offset technology of the CSS background image to render in the Web page, avoiding the download of multiple images

c) merging javascript scripts or css stylesheets

d) take advantage of the browser's cache policy in http to reduce duplicate downloads

5. speed Up server script calculation

a) there are built-in optimization schemes for scripting languages with strong business support. For example, the interpreter caches the intermediate code for the next time when it interprets the script for the first time.

b) There are also many third-party components that provide this functionality for the scripting language of the open source class. such as the APC components of php .

6. Use dynamic content caching: Cache the HTML output of dynamic content and how thousands of cached files are stored

7. Using data caching: Where is the data cache stored? There are many factors to consider: speed, sharing,

8. static dynamic content: Although considerable duplication is avoided, it may seem superfluous to call the dynamic scripting interpreter every time to determine whether the cache is out of date and read the cache, and it takes a lot of time

9. Replace the Web Server Software: Someone holding the so-called test data that Apache is obsolete, do you believe it? On the other hand, the Web Server software you are using may make you proud, but do you know the nature behind the complex configuration? Do you know why it is so good just to handle your site requests? If you want to write Web Server software, you can make him faster. We must stop the blind choice, stop the worship of the surface phenomenon, we need to learn some of the underlying knowledge to arm themselves.

Page Component separation

One . Reasonable deployment of servers:IP, operator, etc. choice

Use load Balancing: Web load Balancing needs to be implemented in a variety of different ways . It could be a simple http Redirect, or a Polling resolution for DNS, or a reverse proxy server for load-balancing scheduling, or through LVs to build a server cluster

Optimized database : 1. Application Data access component design, reasonable data table structure design, frequent database link and release, rational use of various types of indexes, understanding database storage engine characteristics. The data is hashed over multiple hosts, including the necessary redundant data, in order to reasonably disperse the dense access of the database, the database expansion becomes our consideration

Consider scalability : Scalability is designed to accommodate changes in load

reduce visual waiting


This article is from "Buffy Rain Blog" blog, please be sure to keep this source http://bafeiyu.blog.51cto.com/5401101/1752037

Build a high-performance web site

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.