jmeter script development: basic concepts of performance testing (a)

1. What is the (software) Performance Testing

Performance : Transaction, certain characteristics of the evaluation value items

Software Performance Testing : with certain technology to identify or verify a test index value of properties, such as: Do you run 100 meters with a time of how much?

For example:

"See if you have a few two kilograms":

  Gradually increasing the system load, changes in test system performance, and ultimately determine the system can withstand the maximum load

"Oh, big pear!":

  In a large performance pressure, continued to run a long time, look at the system services and resource utilization

  Keywords: greater pressure for a long time +

Usually the test, find the maximum load, such as 100, 100 and then select a slightly smaller than 7 x 24 hours to make stress testing. Usually before the start, first a lower pressure such as 10 or 20 of the test, the test has a reliability described by a certain protection system, when the stress test and then do the performance bottleneck of 90

Reliability testing : under certain given the business pressures, continuous operation for some time, to see whether the system is stable

  Keywords: whether "stable", certain business pressures

Capacity Test : Under certain software and hardware conditions in the database of magnitude different amount of data, the system read and write operations are more tests to obtain performance index values of different magnitude data

  Keywords: different data of the order

For example:

Reliability Test: certain high pressure is not required, a relatively low pressure tests, such as the time of maximum load of 100, 10 or 20 selected

Capacity Test: a query such as user data and user data 10000, the database query response time

II. The purpose of the performance test

Objective: To find some of the key performance indicators or proof system

  1. The new system, never to do performance testing, to find a key performance indicator value

  2. Based on the existing performance based on the performance tests again to verify predetermined performance index value

III. The premise of the performance test

1. Necessity of performance testing - a key assessments

  1) competent authorities, regulatory review

  2) involving the safety of life and property

  3) Large new system

  4) core system

  5) structure adjustment

  6) booms

  7) major bug fixes

2. Testability - quantifiable performance index value

IV. Performance testing tools

1. Open Source: Jmeter

  Java development, cross-platform, version update soon (later recommended v3.2 + jdk 1.8), very active learning materials more

2. Business: loadrunner

  Benchmark performance test software, C language, domestic break (<lr11), lr12 50 limits the number of users a free trial, slow update

3. Self-study: python + locust

  python language developed

V. Performance Test key indicators

1. What are the performance of the software should be concerned about?

What are performance 1) enterprises should be concerned about?

focus point performance Performance
Server utilization Resource utilization  
The greatest customer support System Capacity  
The maximum concurrent users can be supported Number of concurrent users  
It is not to provide replacement hardware performance Scalable  
We can not continue to run for a long time without downtime stability  

 

 

 

 

 

 

 

 

2) What are the performance of developer attention?

focus point performance Performance
Architecture design is reasonable system structure  
Database Design database  
Code logic Code  
Threading, asynchronous, synchronous, queue Implementation technology  
Resource Allocation stability  

 

 

 

 

 

 

 

 

2. Concurrent

Referring to the same point of time to perform the same operation (spike)

 

3. Concurrent (an important indicator) Users

The number of users the same time point, requests execution of the same

System users, online users, number of threads

 

4. transaction (Transaction)

It refers to the process a client sends a request to the server and the server responding

 

Note: The number of threads here refers to the number of virtual users, and developers are not the same thread

jmeter there is usually understood to mean: an interface to respond to requests from initiating a transaction called, LR interfaces in multiple requests can be seen as a response to the transaction, the transaction multiple interfaces written in a bag

 

5. Response Time (RT) (an important indicator)

Initiation request received from the response time

  Network transmission time + origination request server returns a response processing time + network transmission time

 

6. TPS \ QPS (leading indicators)

TPS (Transactions per Second): server number of transactions per second, a measure of the most important indicators of server processing power

QPS (Queries per Second): the number of queries per second

Difference: There may be more than a Transactions Queries, such as access to web pages

 

Note: High TPS, explain the low code complexity, good CPU, low memory consumption, fast database computing power

A transaction may include multiple queries, it may QPS larger, TPS smaller, such as Baidu, it is possible to invoke multiple query interface

RT:想要真正的服务器处理时间,因此实际做测试时尽量不要使用堡垒机、跳转机

 

7. 吞吐量(Throughput)

单位时间内处理的请求数量(事务/s)

如:港口吞吐量,1年5千万标准集装箱

 

8. 吞吐率

单位时间内通过的数据的平均速率(kb/s)

如:港口日吞吐率,年吞吐量/365天

 

9. 点击数(Hit per Second)

每秒点击数

 

10. 资源利用率

指系统资源的使用程度,比如服务器(网络以及数据库)的CPU利用率,内存利用率,磁盘利用率,网络带宽利用率等

CPU利用率

内存利用率

磁盘I/O

 

一般都不要超过80%

 

六. 性能测试步骤

1. 性能测试准备

1) 需求分析,熟悉业务

2) 明确性能测试目标(指标值)

3) 了解软件功能,架构

4) 制定测试模型(编辑测试用例)

5) 指定测试计划,做好工作量评估

 

2. 搭建性能测试环境

1) 工具选型与准备

2) 被测系统环境搭建(服务器、服务版本更新、数据库数据准备)

3) 网络配置

 

3. 性能测试脚本开发

1) 选取协议

2) 制作脚本

3) 调试脚本

4) 验证脚本

 

4. 性能测试脚本执行

1) 试用行

2) 场景执行

 

5. 结果分析与调优

1) 分析依据:结果图表

2) 分析思路:服务器硬件瓶颈 > 网络瓶颈 > 服务器os瓶颈(参数配置、数据库、web服务器) > 应用瓶颈(sql语句、数据库设计、业务逻辑、算法)

3) 调优

4) 修改脚本或场景

 

注意:做性能测试的必要条件:性能测试服务器的配置要尽可能的和生产服务器配置相近

 

6. 测试报告与结果追踪

性能测试报告

性能测试问题跟踪

 

七. 开展性能测试必备条件

1. 网络要求:内网(zoom域)  外网 独立分开 千万不要用跨内网外网

2. 独立环境  功能测试不能和性能测试共用环境

 

Guess you like

Origin www.cnblogs.com/my_captain/p/11756343.html