Performance diagnosis three, single-function scenario performance analysis (Redgate Profiler)

Source: Internet
Author: User

In the previous article, we simply positioned the customer front end and the database backend performance issues, if the two blocks are excluded, the problem is basically determined on the application server. But we tend to be most unfamiliar with the application server, or the performance of the application, in the event of a performance problem often with a sense of disorientation, although our code is most familiar with the application.

There are several reasons for this:

    1. When the system is large and the business is complex, the subjective factors are greatly affected if the code is reviewed. If you add log statistic response time in all the code, it is inconvenient, unscientific, and a lot of work.
    2. The code that you maintain calls the interface of other modules, does not work, and communicates with other module colleagues, which is complicated and difficult to communicate;
    3. Oracle environment is not easy to track the execution of SQL script records, although SQL Server can achieve, but tracking to other modules of SQL also do not know which method is called;

For these reasons, another powerful tool was born---ANTS redgate performance Profiler

: http://www.red-gate.com/products/

Comparison of Redgate and vs self-brought analysis tools

Visual Studio Performance Profiler

The sample profiling method of the Visual Studio profiling tool interrupts the computer processor at set intervals and collects the function call stack.

1. There are too many special terms, the analysis report is difficult to understand

2. Complex operation, integration with VS

3. Cannot synchronize SQL execution, file operations, and crawl analysis

Redgate Performance/memory Profiler

Redgate basically works by putting hooks in the. NET compiled IL code to record time, and then showing what part of the code consumes the most energy through an intuitive interface.

1. Visual interface, simple operation, visual display of the system's performance response and memory allocation situation;

2. Ability to capture SQL script and execution time, SQL and. NET code correlation switch;

3. Specific analysis can be done for the specified thread, which facilitates the quick location of the problem;

Using the example

Start performance, and note that the new profile port is used when testing again.

Using the mouse to select the specified time interval, Redgate automatically analyzes, by default we see the call Tree view, here we note three points:

    1. Call tree shows the thread invocation stack and corresponding CPU consumption and method calls of the process during that time period;
    2. At this point we see the CPU Execution time ratio (or execution time), does not include SQL execution, network, file and other IO blocking wait time;
    3. If the DLL is debug and the corresponding PDB file, select the specified method, you can directly view the source code;

Switch to Method grid, follow the total time of execution of the methods, regardless of the call relationship, the use of the hidden namespace (or only the specified namespace), can easily find and highlight the problem;

The database calls view shows all SQL access to the databases, by default in reverse execution time, with the. NET icon behind the SQL script, which can quickly navigate to the program call stack of the SQL, and the SQL script icon in the calls tree can also be quickly returned to the database Calls interface;

In addition, for the selected area naming, convenient post-analysis, improve work efficiency; when background processing is more complex, such as using multi-threading, or a function that corresponds to many HTTP requests, you can parse the problem by the specified thread;

Introduce the content of the class do not do too much introduction, the next one will be an example, the use of Redgate diagnose a new contact seems very strange problem.

Performance diagnosis three, single-function scenario performance analysis (Redgate Profiler)

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.