Four recommendations for high concurrent access to a Web site

Source: Internet
Author: User
Tags file system functions modify access

It is very important for the construction of large web sites to separate the hard disk from read and write, function and display, to seal the basic functions and to ensure the expansion of the design structure.

The growing size of the Internet, the growing user base and the rise of Web2.0 have put new demands on web site development, high performance and scalability, while supporting highly concurrent access.

separating the hard drive from read and write

If the performance of the site's hard drive is the bottleneck of the performance of the entire website, then you can consider the hard drive read and write functions, respectively, to optimize. On the hard drive that is used to write, if we raise the I/O of the hard drive, it will definitely increase the failure rate of the entire file system because it is the sum of the failure rates for all drives. Hard drive I/O and failure rate can not be both. and read hard disks, you can use a common server hard disk to reduce overhead.

Balanced CPU and I/O consumption, not only to obtain more full server resource utilization, but also to support temporary overload, encounter unexpected events, traffic surge, the result is the overall performance of the system decline, rather than immediately collapse.

function and presentation must be separated

In the late operation of the site, there will certainly be a lot of changes in requirements. If you need to modify the source code for each change, the development of this site can be said to be a failure.

The most important thing is that the function and presentation must be separated. The core features are written in scripting language, and the foreground shows the use of HTML with special tags, which speeds up development and facilitates future maintenance and upgrades. For the foreground template, generally also need to separate the head and tail of the page, the main part of the page also according to the module or function split, this can effectively reduce the pressure on the server.

encapsulation makes development a multiplier

In the functional block level, if using JSP, database connection, session management and other basic functions should be encapsulated into a class. If you are using PHP, you can encapsulate each feature block into a function, file, or class by explicitly encapsulating it in your scripting code.

At a higher level, the site can be divided into presentation layer, logical layer and persistence layer, respectively encapsulation, so that when a layer of architecture changes, will not affect other layers. The recent popular MVC architecture splits the entire site into three parts of model, view, and controller, and there are many good code frameworks to choose from, such as JSP structs, spring,php Php.mvc, and studs. With the ready-made code framework, you can make your site development work with less effort.

capacity to cope with sudden increase in traffic

A large web site, in the design of the architecture, must take into account the possible future capacity expansion. For the Activity class website, the irregular sudden increase flow is huge. On the site primary storage server, specify the ID range of the data files stored on each storage enclosure in the form of a configuration file. When the current server needs to read a data, first by asking the interface on the primary storage server to obtain the enclosure and directory address of the data, and then go to the enclosure to read the actual data file. If you need to increase the enclosure, you only need to modify the configuration file, the foreground program is not affected in the slightest.



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.