学习二、制定负载测试计划
制定负载测试计划一般需要三个步骤:
1.分析应用程序
1)确定系统的组成
画出系统的组成图。组成图要包括系统中的所有的组件,以及相互之间是如何通讯的。
2)描述系统配置
画出系统组成图后,试着回答一下问题,对组成图进行完善:
- 预计有多少用户会连到系统
- 客户机的配置情况(硬件、内存、操作系统、软件工具等)
- 服务器使用什么类型的数据库以及服务器的配置情况
- 客户机和服务器之间如何通讯
- 还有什么组件会影响Response Time指标(比如Modem等)
- 通讯装置(网卡、路由器等)的吞吐量是多少?每个通讯装置能够处理多少并发用户
3)分析最普通的使用方法
了解该系统最常用的功能,确定哪些功能需要优先测试、什么角色使用该系统以及每个角色会有多少人、每个角色的地理分布情况等,从而预测负载的最高峰出现的情况。
2.确定测试目标
Objective | Answsers the Question |
---|---|
Measuring end-user response time | How long does it take to complete a business process? |
Defining optimal hardware configuration | Which hardware configuration provides the best performance? |
Checking reliability | How hard or long can the system work without errors or failures? |
Checking hardware or software upgrades | How does the upgrade affect performance or reliability? |
Evaluating new capacity | Which server hardware or software should you choose? |
Measuring system capacity | How much load can the system handle without significant performance degradation? |
Identifying bottlenecks | Which element is slowing down response time? |
这一步还要确定何时开始负载测试,在不同的阶段进行什么内容的负载测试。见下表:
Planning and Design | Development | Deployment | Production | Evolution |
---|---|---|---|---|
Evaluate new products | Measure response time | Check reliability | Measure response time | Check HW or SW upgrades |
Measure response time | Check optimal hardware configuration | Measure response time | Identify bottlenecks | Measure system capacity |
Check HW or SW upgrades | Measure system capacity | |||
Check reliability |
3.计划怎样执行LR
确定要使用LR度量哪些性能参数,根据测量结果计算哪些参数,从而可以确定Vuser的活动,最终可以确定哪些是系统的瓶颈等。
在这里还要选择测试环境,测试机器的配置情况等。