The basic user service needs online pressure test, but the number of interfaces in this project is 400+, and there is no traffic recording function at present. It is a huge workload to complete the script writing and data preparation of 400+ interfaces. It is necessary to select some interfaces 150+ from 400+ interfaces for performance pressure test, so how to select which interfaces for pressure test?
If the top150 interfaces are based on the number of online requests, but some interfaces, such as the parameter list format, although the number of requests is small, it may still cause a lot of pressure or even avalanche to the server
Based on the experience of performance testing, some rules are sorted out as follows:
- Request a top50 interface in TPS
You need to focus on the interfaces with high request volume
- Interfaces that involve write operations
Write operations are prone to row locks. Write operations trigger operations such as setReids
- The input parameter is the interface to the collection
Confirm the size and influence range of the list uploaded by online users
-
Interfaces that may generate large keys or hot keys
-
Implement logically complex interfaces
Cpu-consuming operations such as for loops
- Frequently operate the database or redis interface
Determine the number of database read and write operations Determine the number of redis read and write operations
-
Online monitoring mysql slow query corresponding interface
-
An interface that is slow to respond online