performance test

 

Record a performance test planning process carried out with the platform team development colleagues in early 2018.

 

Preparation Phase

1. Public area

Figure 1: Configuration header information

Figure 2: Each transaction of the bank project requires a unique transaction flow, and functions, variables or counters can be referenced through "${ }"

Figure 3: The request content of each interface consists of Comm_req, Sys, and Input. The Input area belongs to the business area. The Comm_req area is basically fixed except for the transaction flow, and Comm_req is used as a variable to facilitate subsequent calls.

Figure 4: http request default value settings, eval() function references variables containing variables

Figure 5: Response text assertion, transaction success flags are "status": "S" and "erorcd": "0000"

Figure 6: The three parts Comm_req, Sys, and Input of the request message area are spliced ​​into the variable request, and the eval() call

 

2. Business area

Figure 1: Take the customer account transaction as an example, add a thread group and set it to single thread

Figure 2: Enter the content of the input area of ​​the request message. There are two variables that need to be parameterized, contact_content1 and contact_content2, which must be referenced from the outside

Figure 3: Define the variable contact_content1

Figure 4: Define the variable contact_content2

Figure 5: Add an http request to the thread group of the transaction, jmeter automatically reads the default value of the http request in the public area, and each thread group must have a request

Figure 6: The extracted response result is assigned to the variable cust_no, which is convenient for subsequent transactions

Figure 7: Confirm that the response result is successfully extracted

3. Verify the request result

Figure 1: The fields that need to be parameterized in the request parameters have been generated normally through functions, variables or counters

Figure 2: The response result contains the transaction code and identifier of the successful request

 

Improvement: Build with Test Fragment modular script

 

execute the test

slightly

 

Summarize

1. Click the jmeter start button, the request cannot be sent, and the query result tree does not respond

Reason: The service is not registered or started, there is a cleanup during the test, etc., the service is sometimes not started

 

2. The 4400 transaction requires an activated card number, and the status must be changed in the database. The jdbc request can be sent through jmeter. The variable name in the jdbc connection configuration is the same as the variable name in the jdbc request.

Note: Do not leave spaces at the end of the configuration process, otherwise an error may be reported: Cannot create PoolableConnectionFactory (Access denied for user 'root '@'localhost

 

3. Use the counter to generate the 20-digit card number starting with 003301. If the starting value is 1 and the number format is 00330100000000000000, the first two 0s of the card number will be omitted.

Solution: starting value is 00330100000000000001, number format is 00000000000000000000

 

4. In the mixed stress test, the transaction code may be randomly selected due to get("prcscd"), which will result in the inability to achieve mixed concurrency as required

Solution: Add BeanShell PreProcessor to each thread group and get the specific transaction code, String prcscd = vars.get("prcscd transaction code")

 

5. Monitor plugin usage

See: http://www.cnblogs.com/Ryana/p/8377356.html

 

6. Slow SQL queries

Log in to the server where mysql is located through xshell

Turn on slow queries: set global log_slow_queries = on

Query/set slow query parameters (query time unit: sec): show global variables like 'long_query_time';     set global long_query_time =1; 

Query slow query storage log: show variables like 'slow_query_log_file';

 

eg: 4400 transaction slow query search

Threshold (ms)

Execution time (ms)

location (sql)

10

35

TabDpBusiMain.dpa_account.Entity.selectByIndex_odb1

10

  34

TabDpBusiMain.dpa_card.Entity.selectByIndex_odb1

10

  39

DpAcctQuery.selSubAcctRelateRecord

10

  42

TabDpInterest.dpa_interest_rate.Entity.selectByIndex_odb1

10

  28

DpFroze.selWholeBalFrozeSource

10

  36

TabDpProtocol.dpb_withdrawl_protect.Entity.selectByIndex_odb4

10

  39

DpAcctQuery.selSubAcctRelateRecord

 result targeting

1). DpAcctQuery.selSubAcctRelateRecord [ named sql join on join table query ]

More analysis: http://blog.jobbole.com/107256/

 

7.GC metrics and tuning:

Relevant knowledge learning : JVM-GC principle , JVM-GC collector , monitoring GC , diagnosing GC

Minor GC executes quickly ( within 50ms )

Minor GC is executed infrequently ( once every 10 seconds or so )

Full GC executes quickly (within 1 second )

Full GC is executed infrequently ( once every 10 minutes or so )

[NewRatio=2] Old age: Newborn=2:1

【SuvivorRatio=6】Eden:Survivor=6:1

 Note: The content of brackets is not immutable, and specific services need to be considered

Open the appCtrl file to view the CMS collector parameters, and the development colleagues reminded that these parameters must be changed carefully, otherwise it will have no effect, and Xiaobai weakly said that it will not be changed. . .

Performance Testing Principles

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326271303&siteId=291194637