(Transfer) System performance tuning summary and sharing of vomiting blood

System performance tuning hematemesis summary and sharing
Original URL: http://www.cnblogs.com/wcyao/archive/2011/06/29/2091962.html
Overview

Ø Performance optimization ideas The

first is the more accurate positioning problem, with the help of corresponding The toolkit analyzes where the performance bottleneck of the system is, and decides the optimization method according to its performance indicators and the level at which it is located. When choosing the optimization method, you can refer to the following chapters on the tuning method, the architecture optimization is progressive, and the correct, targeted and step-by-step optimization is carried out. It may be found that some of the guiding ideology may be suspected of contradicting, but there is no need to take it seriously. The process of system optimization itself is a combination of continuous separation and sharing. As for which optimization method to choose, it depends on specific needs, but the development of large-scale applications depends on The general idea is to keep separating and linking them through indexes (non-databases).

Remember: optimization must be done with careful inspection of the system, to find the root cause of performance problems, and not be confused by appearances, prescribe the right medicine, and find the doctor who finds the disease. No worse than a doctor who operates a scalpel. This article has a chapter on the toolkit. For those who need to do optimization, you need to be familiar with it. He is the CT we use for diagnosis. For example, we found that the memory is high. First of all, we think that the memory is not enough, but why the memory is consumed so much. Use the tool to see Looking at where the memory consumption is, imagine, for example, in a hospital, a patient tells the doctor that his heart is not good, and the doctor will replace the heart. In that case, everyone can become a doctor as long as they are proficient in kitchen knives.

Ø Iterative optimization

Performance optimization may not be a one-off It can be satisfied. Maybe the bottleneck has disappeared here. Once the system runs fast, new performance bottlenecks will be found elsewhere, so performance optimization is an iterative work. until the performance indicators required by the system are met.

Ø Optimized cost

Is it possible to design or optimize system performance in one step? Design and optimize according to the best distributed architecture? A single node has always been running and healthy. In theory, it can reach the Comintern, but the actual implementation level is not desirable. It must be combined The actual non-functional requirements are designed and optimized. If one step is taken to the extreme, the cost of the system is too huge. The cost of performance design and optimization alone is higher than the value provided by the system itself to customers, and it also causes the cost of research and development to be too high. Big. The second seems to be that someone who can build such a perfect system has not yet been born. Therefore, one sentence is also suitable for architects: there are ideals but not ideals, and no nonsense: see the
rules for details. Tuning methods
Database optimization For

many applications, optimizing DB is often the most direct, most convenient, and most effective, but not all System performance is at a bottleneck, or after the DB bottleneck is resolved, application layer bottlenecks, WEB layer bottlenecks, and even architecture bottlenecks may emerge. Therefore, database optimization is very important, but many people often understand that system optimization is database optimization, right? comprehensive. The optimization role generally recommends programmers with deep data knowledge, or professional DBAs, not just CRUD developers

Ø Establish correct primary keys, foreign keys, and indexes

Ø Separation principle: separation of reading and writing, separation of business data

a) points Library

b) Partition

c) Partition table

d) Partition column (separate large fields, infrequently used ones to other tables, and query on demand)

Ø Select isolation level: Some of the data consistency requirements are not high, and partial consistency can be sacrificed , reduce lock blocking

Ø ensure short transactions and reduce unnecessary lock mechanism.

Ø Query optimization rules:

e) Avoid correlated sub-queries in the table;

f) Avoid sorting or sorting as few rows as possible,

g) When sorting a large amount of data, the related data is placed in a temporary table

h) . Try to pass more query conditions after where to reduce unnecessary returned rows

i) . Try to select only required fields to reduce unnecessary returned columns

Ø Paging stored procedure: queries of large lists can also use paging storage The process is optimized.

Ø Use database caches, views, temporary tables, etc. to optimize the system to the greatest extent, and perform necessary optimizations on stored procedures and functions

Ø If necessary, fields in tables can be redundant to avoid joint

queries Separate the large fields into separate tables to make them queried separately

Ø When multi-table association must be done, try to filter the data in the tables that do not meet the conditions to reduce the amount of Cartesian product calculation

Ø Complex tables: if the real-time requirements are not high, try to do background tasks as much as possible Calculation to avoid dynamic query
Application layer optimization

Application layer optimization focuses on the logic optimization, algorithm optimization, code optimization, etc. of the application layer itself. The role of optimization can be programmers who are familiar with the application.

Ø Optimize algorithms, select appropriate and efficient algorithms to reduce unnecessary

Recursion

, loop, multi-layer loop nesting and other

calculations After using the

array , etc. , release it in time Services (Rest, Soap), WCF, Named Pipes Ø Reduce the number of communications between applications, such as user authentication services, workflow services, database services







Ø Reduce the amount of data transmitted between applications, do not transfer unnecessary data, and transmit less

Ø Cache mechanism: cache is commonly used, not easy to change, and occasionally changes, you can consider the cache dependency mechanism

Ø Support asynchronous computing, reduce waiting time

Ø Consider delay Loading or loading in advance Ø

Separation principle: separation of business modules, such as separation of large I/O modules, separation of high-consumption memory modules, separation of high-consumption broadband modules

Uncertain
Web optimization Web

optimization favors technicians who are familiar with front-end development Ø Reduce

http requests Ø Avoid

404 errors Ø Compress js Ø Use css sprites technology to synthesize many pictures together, cut through CSS to reduce the frequency and data volume of picture transmission


















In order to show the difference from the application layer optimization, the description of the architecture in this article is more focused on the physical layer. Again, if it involves changing the architecture, we need our application to have good scalability and test the usual skills of our architects. How to just meet the demand and the business increment in two or three years, but not the more powerful, more flexible, more configurable, and the easier it is to expand horizontally, the better. First, consider the input-output ratio of this application, in other words, Is it worth investing so much in architecture design cost? Second, architecture design is also time-sensitive. IT speed is too fast. Today's good things may not be tomorrow's good things. Young and beautiful girls will always become old women one day. Well, in addition, the more flexible the architecture, the more configuration items there are. From a certain aspect, it increases the complexity of the system. Finally, many large-scale and mature applications are not achieved overnight, but through continuous adjustment and optimization, and constantly changing the architecture. Saints are not born, but constantly summarize, refine, optimize, and reconstruct

Ø Use high-performance minicomputers and storage devices in hardware. Use excellent network bandwidth

Ø Physical separation of Web Server and DB Server or other services such as: user authentication service

Ø Cache

ü Data caching mechanism

ü Page caching mechanism

Ø Physical separation of business modules, deploy a single server for a single business

Ø Deploy multiple Web sites Server

Ø Web Load Balancing-F5

Ø Data read and write separation Ø

Use message queue to perform synchronous/asynchronous computing between various

applications Distributed nodes use high-performance servers, small clusters, supplemented by high-speed network bandwidth, etc. Toolkit Ø Process manager, CPU, memory, I/O








Ø Logs: IIS logs, Windows logs, system logs Ø Use dotTrace to track method execution time

, find slow methods, and targeted

optimization As well as the amount of data

sent and received Ø

Performance Count, use counters, statistics related performance indicators






Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326992133&siteId=291194637