Novice notes - website acceleration: not too little, but too many

zhaozj2021-02-16  61

Title: Novice Notes - Website Acceleration: Not too little, but too much

Keywords: website development, website acceleration plan, reasonable selection

August 30: Remembering the website to accelerate steps, it is a hundred feelings!

It hasn't written notes for a long time, and the work of the website is indeed very trivial. However, it is really difficult to do it. Here, this note is reported two months. Many ideas have changed again, so it is very chaotic, please pay attention to it :)

The technical work of the website is actually involved in the face. The design and development of running platforms issued from website information to the design and development of the editing library requires a lot of research and program customization. Comprehensive conduction is not a simple note. This time you will make a brief description of the accelerated scheme. The current website has a lot of integration of zero zero, which is a brief description of these acceleration methods.

Solving the pressure problem of the website is what all commercial websites should consider, from the expected expectations of the visits, and different time-pressure, all need to consider. Hardware is the most important consideration. The software is also very important. Whether the defined framework is suitable, physical databases are separated, these are part of the design phase of the website. But unfortunately, the original website did not make this consideration, but the problem left after the problem, it caused a large pressure after the line. When our new website is just online, the CPU load of the peak period database server has been more than 80%, and the CPU load of the website server remains an average of 70%. Accelerate, accelerate, and then accelerate the question mark and exclamation mark in the leadership mouth.

There are many successful experiences that can be found from the Internet, and of course you can't let go of the successful experience before the revision. So we found the following acceleration method (although I thought about any acceleration method this time was very late, but still going.)

Below is a few acceleration methods

1. ASP.NET itself Page Cache Technology and Data Cache Technology

Various websites development languages ​​will have their own cache technology, which can be used during development. The page cache is a scheme that is cached with <% OutputCache ....%> On the page on the ASPX page. The data cache can cache variables supported by almost all ASP.NET in the way you want to provide to provide program calls.

2. Establish an index for complex queries

In addition to the design of the design, you may need to have a large number of databases with SQL transaction trackers to find the bottleneck of the query statement with SQL transaction trackers, and think about the corresponding approach, such as With the stored procedure, a few temporary tables have been built for a table that have not yet established an index. Because I am not very familiar with my database, I don't have much here.

3. Separate DB read and write

This is a valuable experience from the predecessors. At the same time, it is a very slow database access method for the SQL database. The better way is to establish the two types of structurally identical database servers according to the pressure of the read and write. The data timing of the type of server that is responsible for writing to the server responsible for reading.

4. Separate DB with Web Server

The DB and web server will slow down on one machine. Therefore, it is necessary to make the website accelerate, which also needs to be considered in this regard.

5. Form a static file to form a commonly used data, and more than updated data

The development of the website is very small, such as the detailed article page, and the editors entered our system, it is almost imparty. In this case, a method of regularly generating a static data file in a regular data can be employed. Come speed up the website. The program can achieve the purpose of improving the overall speed of the website by accessing the static file.

Here is a simple description of this manner, when the database is good, read and write to the database is fast than the reading and writing of the file, but if a large number of reads and writes for the database, or complicated every time The logic is read on the database and is not too high in the real-time requirements, which is better to generate a static data file each time, so that the program only needs to read the static file each time. It can achieve the effect of reducing the pressure of the database. Another benefit is that in the case of a data failure that cannot be read, the website is actually on the operation of these static data files, in the early stage of operation of the system, unstable operation, such a data file is very meaningful. This acceleration method can correspond to the data cache of the ASP.NET above. Since all data is stored in a standard XML format data file, this data cache can not only be used on ASP.NET applications, but also available to other applications,

6. A static page will be generated by accelerating the dynamic page to provide a static page snapshot to the user.

Upgrade acceleration plan? You can read the dynamic page to be read, saved as a static page. Similar to the page cache of ASP.NET, the only difference is that the page accelerated can be controlled, and if ASP.NET cannot be executed, the static page can be easily used on other HTTP Server.

The above is a way to accelerate the website that can be used in the ASP.NET SQL environment. It can be honestly telling you that in the case where the system is unstable, or the product is not confident in the system. I personally don't recommend everyone.

After saying the way the current website is used, I want to share with you the experience and some experience and lessons you get. I hope that everyone will not repeat the same mistake during the development process of the next website.

l Accelerate - not too little, but too many

It can be drawn from above, if a website is in the process of design and operation, that is, the acceleration of the database level, there is an acceleration of the business logic layer, and the speed of the final page level, then there is a problem Yes, is it necessary to exist all the acceleration forms? Have you already made some no meaningful cost? In fact, when I re-turned to see all the acceleration methods that stacked in the website, I can't help but have a bunch of questions: Why do I have a bunch of loop-generated data files after I have defined the page cache? Why is the database's indexing is built after the data level cache? In what circumstances, there is a page cache, you need to have a page acceleration? ...... When a lot of piles appear in front of you, you can understand that it is not too small to give a website acceleration, but too much, what you have to do is to choose the least, the most appropriate solution To deal with the problems you have to face, rather than panic, all the acceleration programs you have to know on the website, so the result may be the low update efficiency of the website, the maintenance cost increase, uncertain Sexual is also increasing, and so on. Therefore, remember, accelerate the method, not too little, but too much, to choose reasonably.

l Don't make a certain solution because of an error

If you tried the method of data acceleration, I found that your website's access speed has not been well improved, so what would you? After giving up, find a new road, or what is the result of carefully studying your test? Look at what I said above, when you have too many choices, you may not look heavy for each item, then you are wrong, my project team has gone through some turning road when choosing acceleration, these The back of the road is because we put forward a good solution A. Try it, there is no good effect immediately, go to another experiment, through a period of operation, suddenly found that the scheme A is not so good because of other The reason, not the reasons for programs A itself, and then look back in scheme A, which takes a lot of time and energy. Therefore, in the case where you can choose a lot, you must also carefully consider it, instead of your veto of a certain approach because of an error. All in all, the website acceleration must be a plan to be planned at the beginning of the design phase, and the adjustment after the design is very painful, this is a common place in terms of aspect programming (AOP). AOP's question is looking back and discussed with you.

The accelerated part is these ideas, you are welcome to communicate with me, my mail address is viktoryu@hotmail.com

转载请注明原文地址:https://www.9cbs.com/read-24190.html

New Post(0)