Performance Analysis and Report of Real Performance Test Cases

Today I will mainly share with you a case of a real performance test that I have done, mainly for the part of the performance test analysis report process. I hope it can help you how to do performance analysis and reporting in the future. The test purpose of this case is: the online exam is an important module in the "XX platform". According to the current business needs, it is necessary to test whether the online exam can support 100 concurrency.

1. Scenario description

Take the step-by-step increase in the number of users (increase the number of users by 20 every 10 minutes) to conduct concurrent operations on the online exam until the number of people reaches 100; when the number of concurrent users reaches 100, it will continue to run for a period of time (30 minutes).

2. Test environment configuration

1. Test server configuration


After multiple rounds of configuration testing and counter observation and analysis (the test is only a block of the system performance test, there are performance tests of other modules in front. Of course, if the test system is tested separately, parameter tuning should also be performed according to the test result data. Specifically which are the performance factors, and finally confirm the best parameter configuration of the program, tomcat, JVM and MySQL as follows: 2. Server software configuration

Program parameter setting

jdbc.minPoolSize=50
jdbc.maxPoolSize=1500
jdbc.initialPoolSize=50
jdbc.maxIdleTime=60

tomcat server.xml parameter configuration

maxThreads="1000" minSpareThreads="25" maxSpareThreads="75"  maxIdleTime="60000" />
maxKeepAliveRequests="1" redirectPort="443"  />

JVM parameter configuration:

-XX:PermSize=64M
-XX:MaxPermSize=128m
-Xms512m
-Xmx1024m

MYSQL parameter configuration:

max_connections=1500
thread_cache_size=128
back_log=200

3. Analysis of test results

1. When the number of concurrency is 60, a 500 server error occurs, and the number of database connections reaches the maximum value of 1499 through the counter monitoring check

1) View of the relationship between the number of concurrency and server errors

2) The relationship between the number of database thread connections and errors

Through the analysis of the above two charts: a bottleneck occurs in the process of gradually increasing the number of concurrency, and the cause of the bottleneck is that the number of database thread connections reaches a saturation value of 1499.

2. Test after adjusting max_connections=11500 of MYSQL

After adjusting the parameters, it is still found that the number of mysql threads cannot continue to rise after reaching 1499. Reason for confirmation: Windows 32-bit system, the memory space available in a process is only 2G, and by default, a thread stack needs to reserve 1M memory space, so theoretically a process can open up to 2048 threads, but the memory is not possible It is completely used as the thread stack, so the actual number is smaller than this value. So 1499 is the peak number of threads in the test environment.

3. According to the previous pressure results, adjust the concurrent number to 40 for testing

It is found that when the number of submitted test papers reaches about 1300, the data thread still reaches 1499, and finally a server 500 error occurs when the test papers are submitted again. The test is stopped after the error is found (when the concurrency is 40, the operation is stopped when 500 errors are found, so the number of failures is 1), and the statistics of the transaction throughput of the test process are as follows:


​According to the analysis in the above table: When the number of test papers submitted by students exceeds about 1300 in a short period of time (such as 30 minutes), when other students submit test papers or perform other database-related operations, a server 500 error will occur.

4. Test conclusions and suggestions

test conclusion

The online exam on the platform does not support a concurrent number of 100.

The performance bottleneck is that after a period of time (such as 30 minutes), after students submit more than 1300 exams, the number of data connections reaches the peak value of 1499 allowed by the server, resulting in 500 server errors during exams and other operations.

In this configuration server environment, MySQL's max_connections=1500 is the maximum setting for the number of data threads, and it will not work if it exceeds.

suggestion

A. Optimize the background processing program as much as possible to reduce the number of database connections required for the examination business.

B. In the process of making test data, it is found that when the exam is arranged by the department (there are many department users, such as 2000), there is no response when clicking the "Enable" button, and the actual background is already doing the assignment of the exam. Therefore, it is recommended to optimize this function. If you click to enable the test, the status should be changed in time, and the allocation process will be done in the background.

C. The processing method of the background distribution test is too slow, it is recommended to optimize it to shorten the processing time.

Practical case

Optical theory is useless, you have to learn to follow along, and you have to do it yourself, so that you can apply what you have learned to practice. At this time, you can learn from some actual combat cases.

If it is helpful to you, please like and collect it to give the author an encouragement. It is also convenient for you to quickly find it next time.

If you don’t understand, please consult the small card below. The blogger also hopes to learn and progress with like-minded testers

At the right age, choose the right position, and try to give full play to your own advantages.

My road of automated test development is inseparable from the plan of each stage along the way, because I like planning and summarizing,

Test and develop video tutorials, study notes and receive portals! ! !

Guess you like

Origin blog.csdn.net/m0_59868866/article/details/131133913