Performance testing knowledge-Principles of Performance Analysis and Optimization

Source: Internet
Author: User

 

Recently, I 've been struggling with how to analyze and tune performance, starting with hardware orCodeOr database. From the Operating System (CPUScheduling, memory management, process scheduling, DisksI/O), Network, protocol (HTTP,TCP/IP), Or from the applicationProgramCode, database optimization, and middleware configuration.

Multiple MiddlewareWebMiddleware (Apache,IIS), Application Middleware (Tomcat,WebLogic,WebSphere) And so on. Even though they are all middleware, it is not a overnight task to learn from each other. However, tuning requires more than just "knowing" or "using" each item. At least we need to achieve "how to better use ".

It is often seen in the performance test book that performance testing is not just a matter of performance test engineers alone. YesDBA, Developers, O & M personnel. However, in many cases, performance testing is performed independently by the performance tester. Even with the assistance of other personnel, the modules that understand the system architecture can greatly improve the performance of the system, the same process is more respectful to others.

 

Before performance tuning, we need to mention the purpose of testing, or what is the original intention of Performance Testing?

Capability Verification: Verify the capabilities of a system under certain conditions.

Capability Planning: How to make the system meet our required performance capabilities.

Application diagnostics: For example, memory leakage is hard to find through functional tests, but it is easy to find out through performance tests.

Performance Tuning: To meet user requirements, further analyze and identify bottlenecks, optimize bottlenecks, and improve overall system performance.

 

 

 

General system bottlenecks

 

Performance testing and Optimization requires first identifying the bottlenecks, which of the following are the bottlenecks of the system:

Performance bottleneck on hardware:

It generally refersCPU, Memory, diskI/OProblems include server hardware bottleneck, network bottleneck (which can be ignored for LAN), Server Operating System Bottleneck (parameter configuration), middleware bottleneck (parameter configuration, database,WebServers), application bottlenecks (SQLStatement, database design, business logic,Algorithm).

 

Performance bottleneck in Application Software:

It generally refers to the application server,WebServers and other application software, including database systems.

Example: MiddlewareWebLogicTheJDBCThe bottleneck caused by unreasonable parameter settings of the connection pool.

 

Performance bottleneck in applications:

It generally refers to newly developed applications by developers.

For example, the program architecture planning is unreasonable, and the program design is faulty (the number of threads used for serial processing and request processing is insufficient), leading to the bottleneck caused by the low performance of the system in the case of a large number of user locations.

 

Performance bottleneck on the Operating System:

It generally refersWindows,UNIX,LinuxAnd other operating systems.

For example, when the physical memory is insufficient during performance testing, the virtual memory setting is unreasonable, and the switching efficiency of the virtual memory is greatly reduced, resulting in a large increase in response time, in this case, the performance bottleneck occurs in the operating system.

 

Performance bottleneck on network devices:

It generally refers to firewalls, Dynamic Load balancer, switches, and other devices.

For example, a dynamic load distribution mechanism is configured on the Dynamic Load balancer. When the hardware resources on an application server have reached the limit, the Dynamic Load balancer sends subsequent transaction requests to other application servers with lighter loads. During the test, it was found that the Dynamic Load balancer did not play a corresponding role, and the network bottleneck can be considered.

 

The causes and positioning of performance testing are very complex. Here, we only briefly introduce several common bottleneck types and features. What performance testing needs to do is to comprehensively consider various factors and then assist developers.\ DBA \O & M personnel work together to locate performance bottlenecks.

 

 

General optimization steps

 

Optimization steps for general performance problems:

Step 1: Confirm the problem

Application code: In general, many program performance problems are written. Therefore, for the module that discovers the bottleneck, check the code first.

Database Configuration: it often causes the whole system to run slowly, suchOracleLarge databases are all requiredDBAOnly correct parameter adjustment can be made for production.

Operating System Configuration: unreasonable configuration may cause system bottlenecks.

Hardware settings: hard disk speed, memory size, and so on are all likely to cause bottlenecks, so these are the focus of analysis.

Network: network conflicts and network delays due to heavy network load.

 

Step 2: Confirm the problem

After determining the problem, we need to determine whether the problem affects response time throughput or other problems? Are most users or a few users having problems? If there are a few users, what are the operations between these users and other users? Is the system resource monitoring result normal?CPUDoes the usage reach the limit?I/OWhat is the situation? Is the problem concentrated in a certain type of module? Is there a problem with the client or server? Is the system hardware configuration sufficient? Does the actual load exceed the system load capacity? Is the system not optimized?

Through these analyses and some system-related problems, you can have a deeper understanding of the System Bottleneck and analyze the real causes.

 

Step 3: Determine adjustment targets and Solutions

High system throughput, shorter response time, and better support for concurrency.

 

Step 4: Test Solution

Benchmark the system after the optimization through the solution. (Benchmark Testing refers to the quantitative and comparable testing of a certain performance indicator of a class of testing objects by designing scientific testing methods, testing tools and testing systems)

 

Step 5: Analyze optimization results

Does the system optimization meet or exceed the predefined goal? Whether the overall performance of the system is improved or other problems are solved by some system performance. Whether the optimization can be completed.

Finally, if the expected goal is reached, the optimization work will basically end.

 

The following is a skill. For example, if the interviewer asks a performance question hypothesis that I don't know where the performance problem is, I can follow this advice to answer ^_^.

•Locate the bottleneck in the following order, from easy to difficult.
Server hardware bottleneck---> Network bottleneck (for LAN, do not consider it)---> Server Operating System Bottleneck (parameter configuration)---> Middleware bottleneck (parameter configuration, database,WebServers)---> Application bottleneck (SQLStatements, database design, business logic, algorithms, etc)
Note: The above process is not required in each analysis. The analysis depth should be determined based on the test Purpose and requirements. For some low requirements, we have analyzed where the hardware bottleneck of the system will be under the heavy load pressure (number of concurrent users and data volume) of the application system in the future.
•Segmentation division is very effective.

 

 

Highlights of performance testing and optimization:

  • Key Aspect 1: During the design and development of application systems, performance should always be considered.
  • Key Points2: Identifying clear and clear performance goals is the key.
  • Key Points3: Ensure that the program running after optimization is correct.
  • Key Points4: The system performance depends on a good design to a greater extent. tuning skills are only an auxiliary means.
  • Key Points5: The optimization process is iterative and progressive, and the results of each optimization must be fed back to subsequent code development.
  • Key Points6: Performance Tuning cannot sacrifice the readability and maintainability of the Code.

 

 

 

This article only introduces some things that need to be concerned about performance tuning and the general points of performance tuning. There is no specific explanation of how to optimize each part of the system, how to elaborate on it is not clear in one or two books, and the requirements for knowledge are also very high, my current capabilities cannot be touched.

 

Here is a summary:

The performance test series has basically ended. Although it takes a long time, I didn't give it to eunuch. Although I am not talking about performance testing theory, I think these things are essential for your performance testing work. Of course,JmeterBasic andLoadRunnerTIPS: describes how to use two performance testing tools.

If myArticleI am very happy to be helpful to anyone who wants to know and learn performance.I am not a masterIt's just a beginner who loves Testing Technology with you, but he prefers to summarize it. He is also often confused about his future, but I know that as long as he goes off learning, the road is ahead. I will sort out performance tuning articles later.

Performance testing summary of all articles: http://www.cnblogs.com/fnng/archive/2012/08/17/2644878.html

 

 

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.