System: The interface management system developed by oneself
System code: Https://github.com/yangjing1989/API
Two key points: simulate a large number of concurrent users & monitoring System load parameter Analysis system bottleneck
Tools: Top (H Help), Sysstat (needs to be installed on the server), Uwsgitop,jmeter
* Test environment to facilitate testing, modify Sysstat to obtain system information interval of 1 minutes (default is 10 minutes)
Vi/etc/cron.d/sysstat
First, recording and playback
1, add HTTP request default value
2. Add Recording Controller
3. Add HTTP Proxy to Workbench
4, click "Start" to start recording
5, browser settings agent
6, access to the test application, click "Stop" to end the recording
7. Remove redundant requests
8, after the login request add Cookie,cookie value set reference Browser cookie value
9, Playback View results
Second, the script parameterized
1. Add CSV Data Set Config
2. Configure the parameterized data and set the name of the parameter
3, the application of parameter values in each request, such as
Third, to determine whether the page is correct
1. Add Response Assertion
Simulation of multi-user concurrency
1. Set up multiple users in the thread group
2, top view Application server performance, found that the CPU, memory and other indicators are in the normal range. And there is no output error in JMeter.
3, increase concurrent users to 200, to see server performance, the CPU for a long time than the average response time in 90%,jmeter has more than 5 seconds, indicating that the system has reached its limit.
4, increase concurrent users to 205,jmeter has begun to appear a large number of errors.
5, the whole process found Uwsgi occupy a large number of CPU,UWSGI is my application use of the Web server. The application itself consumes a large amount of CPU, in which JMeter can see that the login interface has a longer response time than the other interfaces, and receives more than 5 times times more data from the server per second than any other interface. Indicates that the login interface needs to be optimized.