Points to know in the design of the Web system architecture (front-end article)

Source: Internet
Author: User
Tags varnish

Did not write last week, this week to write some of the Internet system development needs to understand the technical points, each point can be divergent, connect more knowledge points, intends to do a gradual refinement of the record.

The entire life cycle of an application (raw, old, sick, dead) needs to have a holistic plan.

Early

Evaluate the requirements and refine the non-functional requirements as needed, as a reference for capacity evaluation. Generally is roughly estimated, technology development to now, if it is a chat or game application, a random server can maintain 100w-160w and so on TCP long connection and communication. So the general start-up phase of the application generally do not have to worry about design problems, you can wait for business slowly to adjust the system architecture.

Many countless small systems on the internet on the line is in luck, under the guidance of lean entrepreneurship, in order to test the business model, first to get a prototype system. Sometimes no users, more users and the top, to find a group of foreign experts to fire, but also a happy worry. Some mobile application authors do not know why they suddenly fire, and then quickly disappear into the market.

Front-end system design Patterns

This is explained by the entire process of HTTP requests arriving at the server. HTTP requests are received from the server, and on the entire reaction chain until the final database is hit, there is a corresponding technique at each potential bottleneck point to support performance optimizations.

Load Balancing

If a business system user has 5 million, need to estimate the maximum number of HTTP requests according to the active user during the peak period of the business, design the front-end reverse proxy, load balancing strategy according to the request quantity; This block considers the differences in common (soft/hard load) reverse proxy facilities (NGINX,LVS,F5, Haproxy

Nginx

Nginx:http Layer load Balancing, reverse proxy, global choice. Because it works on layer seven, you can support forwarding of HTTP URL levels. Casual encounters with a bug on the internet may be a Enginx bad Gateway's fault.

Lvs

LVS:TCP/UDP layer load Balancing, because the work in four layers, the face is connected, processing is the DST ip,port;src ip,port things.

The common forwarding mode has DR (modify the target address Mac), traffic through LVS, but the IP packet return does not pass LVS, the performance is better, LVS will not become a bottleneck.

NAT: The network packet must pass through LVS, and the load on the LVS will be higher than the DR mode.

In order to save a single point, the high availability of LVS need to use keepalived to do dual-machine master preparation.

F5

Hardware products, expensive, the price is easy to million, there are problems to find manufacturers, in fact, this sometimes find the problem on the line is restricted.

HTTP caching

After the equalizer is here, this level of caching is to reduce the read pressure on the application server for a large number of static small files (css,js,jpg). Optional Varnish,squid and so on.

Squid: Old products, support forward/reverse proxy cache, as a persistent cache, can support large capacity, has its own memory page/disk page management, and some CDN products are based on this product transformation.

Varnish: Designed for memory cache, memory management by operating system control, for non-persistent requirements of static file performance good, film.

Ngnix: The extension is good, there is a cache module, but usually the cache itself some page.

Apache traffic Server:apache is also available as a good choice.

Application Server

The number of application servers after the reverse proxy (Tomcat,jetty) takes into account the processing power of the application server itself, such as the regular Tomcat benchmark data is 1000QPS, which is only the average level of tomcat in the case of open NiO.

Its processing performance is also affected by intra-application processing logic, such as caching of applications, and the time spent by service-application RPC across applications.

Finally hit the database on the database before there is a lot of work to do, reduce the burden of the database.
More than 10, next time continue.

The article comes from the platform "malt bread". Reprint please specify.

Points to know in the design of the Web system architecture (front-end 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.