Performance testing process (focus)

The demand for research - design scene - Manufacturing script - preparing the environment - for configuration - optimization proposal

Pressure measuring what we all should know:

1. Pressure test scenarios, user behavior

2. Pressure measurement Service Configuration:

   Audit, available memory, network bandwidth (rate = upload and download network bandwidth / 8), sensing the network pressure (no bandwidth restrictions, limitations and is equivalent to not work in the door of a room), the external pressure sensing network ( there are bandwidth limitations)

3. application servers, database services:

For example, put mq server CPU that he may slow the decline, if mq server CPU cache is too high or too high, it may indicate mq which put too many things, reducing the number of unnecessary applications, such as high CPU , may consider adjusting the kernel parameters, server download broadband is too small, you can increase broadband, added from the original 50kb of 20kb.

Important: If a particular application of the release of that server hang up, then this application to enter this business will be paralyzed, this is not a load of things, can lead to loss of function paralyzed business, such as: order entry mq, but the corresponding mq this server hang, then the order processing even if the business is missing, it must be clear how the load of the program under what circumstances, what time to enter that server node, the server distributes the recommendations put forward.

4. Understand each application:

  Each application is doing what? What they are doing is characterized by? They do things that consume those resources? (Eg: more consumption of memory, compared to those consuming cpu, compared to those eating broadband)

5. Analysis Index:

  CPU, memory, and other changes at the inflection point, the server doing?

  The worst state how much CPU usage arrival time is best / worst state, cache, IO and so much to achieve the best state /

  Report the polymerization: Throughput (TPS), as well as some response time, understanding the relationship between all indicators.

6. Optimization Tips:

CPU too high: adjust the kernel parameters

Memory is too high: increase the memory, task distribution ratio adjustment, a small adjustment

Received KB / sec:   reached the bandwidth limit, widening network bandwidth, improve: rate = upload and download network bandwidth / 8

Application service deployment architecture: for example, put a slow mq server CPU that he might fall if mq server CPU cache is too high or too high, it may indicate mq which put too many things, reducing the number of unnecessary applications

  Important: If a particular application of the release of that server to hang up, then this application to enter this business will be paralyzed, this is not a load of things, can lead to loss of function paralyzed business, such as: order entry mq, but the corresponding mq this server hang, then the order processing even if the business is missing, it must be clear how the load of the program under what circumstances, what time to enter that server node, the server distributes the recommendations put forward.

Slow sql query: optimization sql, database optimization.

Code redundancy: Optimizer.

7. In fact, we can for each of these indicators above are designed to look at a scenario where their bottlenecks

 

A, TPS: Transactions Per Second (processing of the number of things transmitted per second), i.e., the number of transactions per second server process. TPS includes a message into a message and a plus one user to access the database. (The TPS = CAPS × average per call TPS)

TPS is a unit of measurement software test results. A transaction is the process of a client sends a request to the server and then the server to respond. The client requests the transmission start timing, end timing after receiving the server response, in order to calculate the time of use and the number of transactions completed.

In general, the number of performance evaluation system are completed technology transactions per second to measure. The system as a whole depends on the processing power of the minimum TPS value processing power module.

 

Two, QPS: QPS queries per second rate is a measure of a particular query server within the specified time how much of the processing flow, on the Internet, as the performance of the domain name system server machine is often used to measure queries per second rate.

Corresponds fetches / sec, i.e., in response to requests per second, that is, the maximum throughput.

Here to talk about the reasons why the pressure measured in TPS do not increase:

1, network bandwidth

In the stress test, sometimes you want to simulate a large number of user requests, if passed in unit time a packet is too large, exceeding the capacity of transmission bandwidth, then it will cause network resource competition, indirectly lead to service requests received at a number of less than service processing capabilities of the end cap.

2, the connection pool

Number of connections available too, resulting in a request to wait. Generally divided into server connection pool connection pool (such as Tomcat) and a database connection pool (or the maximum allowed number of connections is understood to be OK).

(Details about the connection pool, refer to previous blog: Performance Testing: connection pooling and thread )

3, garbage collection

From the common application servers, such as Tomcat, because of java stack memory is dynamically allocated, the recovery mechanism is based on a specific algorithm, if the new generation of Eden and Survivor areas frequently carried Minor GC, old age full GC also recovered more frequently, then the TPS

Also have a certain influence, because garbage collection will take up some of its own resources.

4, Database Configuration

High concurrency, if the request data needs the time to write a database, and a plurality of tables to be written, if not the maximum number of connections to the database, or writing data SQL no index variable is not bound, or not separated from the master, write separation,

Will lead to database transaction processing is too slow, affecting the TPS.

5, a communication connection mechanism

Serial, parallel, long connection, pipe connections, etc., affect different connections, but also indirectly be TPS.

(Agreement on the connection, refer to previous blog: HTTP protocol Advanced: Connection Management )

6, hardware resources

Includes a CPU (configuration, usage, etc.), memory (occupancy rate), the disk (I / O, page swapping, etc.).

7, press

For example jmeter, limited load capacity of stand-alone, if need to simulate user requests exceeds its load limit, also indirectly affect the TPS (this time on the need for distributed pressure test to resolve the issue of its single load).

8, pressure test script

Or in jemter For example, before work colleagues encountered were stepped pressure test, simulation largest number of requests exceeds the number of threads, resulting in inadequate thread.

Mention this reason, want to express the meaning is: Sometimes the test script configuration parameters and other factors also affect the test results.

9, the business logic

Decoupling of low traffic, more complicated, the entire transaction is elongated line problems caused.

10, System Architecture

Services such as whether there is a cache, the cache server configuration, cache hit rate, cache and cache expiration penetration, etc., will affect the test results.

 

PS : performance bottleneck analysis not just from the local analysis, to be together, multi-dimensional analysis of the problem. Some listed above, there may be missing or improperly described, for reference purposes only. . .

If there is not accurate, please correct me comment, thank you!

Guess you like

Origin www.cnblogs.com/QaStudy/p/11514831.html