Performance test --- analyze demand

Preparation for the needs analysis

  • Acquisition performance requirements: including business transactions, business volume, business volume trends, user information, system architecture, business indicators, system hardware indicators, etc .;
  • Analyze the collected performance requirements: determine the scope of performance testing, what can be measured, and which indicators should be measured and tested; analyze user usage, distribution of business volume, business volume; estimate TPS and number of concurrent users, etc. ;

Performance test indicators

  • Business indicators: including TPS, RT, transaction success rate, etc .;
  • Hardware performance indicators: CPU usage, memory utilization, disk utilization, etc .;

The main content of performance test collection

  • System architecture: middleware configuration, database configuration, etc .;
  • Information on business volume
  • Business volume expansion trend
  • Does the system have an archiving mechanism
  • The peak period of traffic
  • System online users, active users, and business distribution;
  • Whether the system is associated with a third-party system;
  • System business performance indicators
  • System hardware index

Give a chestnut

Take the jforun forum as an example for performance testing;
1) The collected requirement information is as follows:
the main function information of the forum can be given through the requirements document, such as what the forum can do, and other information needs to be given through statistical tools, taking Baidu statistics as an example Statistical tools TheBusiness volume chart
Hardware system index
High score business map
above is the collected data information. Through this data, we began to analyze performance requirements, including speculation on throughput TPS and concurrent users;
2) Analyze performance test requirements (TPS, concurrent users, etc.)

  • Business volume: According to statistics, the daily PV volume is 20,000, and the system expansion trend is to increase by 30% in 3 years, so the daily PV after 3 years ≈ 2 * (1 + 30%) * (1 + 30%) ≈ 33,800
  • TPS: The average number of transactions per second . According to the forum system, sending a new post is a transaction, and returning a new post is a transaction;
    and pv represents a request for the page, but the requested content may include pictures, JS, etc. When calculating, PV≈TPS ; The
    calculation of TPS is usually calculated according to the data in the peak period. From the peak data table, it can be seen that 9 am to 10 am and 14 pm to 15 pm are advanced time periods, which are calculated according to ten am. As can be seen from the data in the table, the PV number at 10 is 1300 + 2706 + 526 + 676 = 5208PV, then TPS = 5208PV ÷ 3600s≈1.45, the calculated result is an approximate value, generally speaking if you can It is more accurate to get the business volume value per minute. Usually, the 28 principle is used when calculating TPS (that is, 80% of the transactions are completed in 20% of the time). So another better calculation method is the following table:
    TPS estimate
  • Number of concurrent users: Commonly used methods for calculating the number of concurrent users 1) Estimate the number of concurrent users by the number of TPS; 2) Estimate the number of concurrent users by the number of online users; 3) Estimate the number of concurrent users based on experience; In
    most cases, use: Number of concurrent users = TPS (Runtime + Thinktime) where Thinktime is 3; Runtime is the time required for the test program to run once;
    the number of concurrent users of this forum system is estimated to be 76 = 5.8
    13; select the number of concurrent users for each business as follows:
    Concurrency estimate
    PS :
    The average number of concurrent users is as follows
    1) The average number of concurrent users is C = nL / T
    2) The peak number of concurrent users C '= C + 3 * root number C
    C is the average number of concurrent users, n is the number of login sessions, and L is the login The average length of the session, T is the length of time the value is examined; C 'is the peak number of concurrent users
    used in most cases: concurrent users = TPS * (Runtime + Thinktime) where Thinktime is 3; Runtime is required for the test program to run once Time; or there are Runtime and Thinktime as response time
Published 22 original articles · praised 5 · visits 1040

Guess you like

Origin blog.csdn.net/weixin_37018468/article/details/104777248