Constructing High-Performance ASP. NET Applications (II)-performance optimization Embedding Method

Source: Internet
Author: User
Tags high cpu usage

BuildHigh PerformanceASP. NET application (2 )-Performance OptimizationLimit Method

 

InPrevious ArticleWe have already stressed the importance of thinking, because thinking determines the follow-up actions. Many times, when building a high-performance application, we need to know how to improve the application.ProgramIn other words, we need to know from which aspects to improve the performance, but also how to locate and solve the performance problems.

 

You may ask: why is this article named "performance optimization Compaction Method ". In fact, this is a concept borrowed from case-solving reasoning. If you have read Sherlock Holmes, you will understand what I mean.


20130307021415. PNG (20.97 K) 11:21:31

 

 

In real projects, we actually encounter "tuning": we encounter performance problems, find out the problems, and solve them to improve application performance. Many projects are remedy after the event and try to improve the performance. This is also a situation we often face.

 

In many cases, performance problems are often not as simple as we can see on the surface, because many factors are intertwined, resulting in performance problems. But in any case, "There is only one fact," that is, there must be a final "culprit that causes performance problems. For example, if we see that the server's CPU remains high and we think it is a CPU problem and are in a hurry to change the CPU, this operation may be wrong, there are N or more factors that cause high CPU usage. For example, insufficient memory will lead to high CPU usage, because the CPU needs to save the data originally stored in the memory on the disk page, in this way, CPU scheduling and read/write frequency are greatly increased, resulting in high CPU usage. Originally, we only needed to add a memory, which eventually led to a CPU change. Maybe this memory problem is not the final problem. It may be that some places in the program do not properly use the memory. For example, if the data is not obtained on demand, instead, each time you get more than N unnecessary data.

 

 

Therefore, optimization is a simple process, which requires constant reasoning and then proceed to the next step..

 

 Optimization is also a process of continuous iteration. When we solve one of the biggest "culprit", there may be another "culprit" that was originally small ". In this case, we may be a little dizzy. For example, if the boss of the gang is killed, the original second child will become the boss. At this time, we must also take this second child out ..., Then the gang boss who finally came to power has no threat to us, and we can stop it.


Performance optimization is like the above process of "killing the gang boss". We cannot take all the gangs out, because there will always be fish that leak the internet, and "black and white are all in one mind ", if you really want to completely eliminate it, it will be too costly, as long as they don't get rid of it, you can tolerate it. During performance optimization, we constantly solve the obvious performance bottlenecks that affect the normal operation of system services. Because performance optimization is a never-ending process, there is no optimal, only better.

In the process of building high-performance applications or tuning, you must have a benchmark to know when to stop.



Generally, performance benchmarks are determined based on the business. Performance indicators vary with applications. Performance indicators vary with different periods, even for the same application, different functional modules have different performance indicators:

 

 

To know how to build a high-performance. NET application, you must first know how to tune it. Why?

For example, if you want to become a security expert, first of all, you have to be a very powerful hacker, or you need to know many hacker things, because only know yourself and yourself, you can defend better. Similarly, if we want to build a high-performance application, first of all, we need to know That there may be performance problems, if there is a performance problem, how can we quickly and accurately locate performance bottlenecks and solve them.

The performance problems in applications are analyzed to find out the bottlenecks, and then we can know: what performance problems are generated, we will avoid these performance problems in subsequent project designs.

If we say that building a high-performance application is a positive reasoning, "precisely locating performance problems" is an inverse process.

From here we can know:

    • Building a high-performance application is a mental task. Instead of building a few devices, you just need to buy a few software. If you do not find a performance bottleneck, it would be a waste to build more devices, it can only be temporarily mitigated, but the problem will still come out, and will be magnified as the number of devices increases.
    • Building high-performance applications requires strong thinking capabilities and the ability to push and reverse.
    • Building high-performance applications requires a deeper understanding of knowledge and a certain degree of breadth.

 

More:

Building high-performance ASP. NET Applications (I)-first correct the ideas and then remedy the problems

Building high-performance ASP. NET Applications (III)-starting from monitoring, making everything speak with data

Building high-performance ASP. NET Applications (IV)-performance optimization goals 

Related 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.