The key indicators of performance tests of attention

First, the software performance testing What are the key indicators need to be monitored?

The purpose software performance testing mainly in the following three points:

Ø current performance evaluation system to determine whether the system meets the expected performance requirements.

Ø software system to find performance problems that may exist, locate performance bottlenecks and solve the problem.

Ø determine the performance of software systems, predictable system load pressure tolerance, prior to application deployment, evaluate system performance.

For users, the most concerned about the current system:

Ø whether to meet the performance requirements on the line?

Ø bearing system limits how?

Ø How system stability?

       Therefore, for the above performance testing purposes and concerns of users, to achieve the above purpose and to answer user concerns, it must first conduct performance tests and a clear need to collect, what are the key indicators to monitor, under normal circumstances, the performance test monitoring indicators Main divided into: system metrics and resource indicators, as shown, the resource index is directly related to the hardware resource consumption, and the system index is directly related to the needs of the user and the scene.

Testing can monitor key indicators Description:

Ø   resource indicators

CPU usage: the percentage of system processes and user processes of CPU time consumed, the time, the generally accepted upper limit is not more than 85%.

Utilization Memory: Memory Utilization = (1 - free memory / total memory size) * 100%, generally at least 10% of the available memory, the memory usage acceptable limit of 85%.

Disk I / O:  disk is mainly used to access the data, so when it comes to IO operations, will there are two corresponding operation, when the stored data corresponding to the write IO operations, when the corresponding data is taken IO read operations, is generally used (percentage occupied by the disk read and write operation time)% disk time Measuring disk read and write performance.

Bandwidth: ships using the counter Bytes Total / sec measured, Bytes Total / sec rate is expressed as the transmission and reception of the bytes, including framing characters included. Determine whether the network connection speed is the bottleneck, the bandwidth can be compared with the counter value and the current network.

Ø   System Specifications:

Concurrent users : a physical time users submit requests to the system.

Online Users: the number of users accessing the system within a certain period of time, these users do not necessarily submit a request to the system.

Average response time: the average response time of the transaction processing system. The response time of the transaction is to submit a request to access the client receives the time consumed by the server response from the client. For rapid system response class page, response time is typically about 3 seconds.

Transaction success rate: the performance test, the definition of a transaction or performance metric for a plurality of business processes, such as user login, save the order, the operation can be defined as the order submitted transaction, as shown below:

Unit of time the number of system-defined transaction can be successfully completed, the reaction processing capability of the system to some extent, generally transaction success rate metric, is calculated as follows:

Timeout error rate: mainly refers to the transaction due to a timeout or other internal system error caused the failure rate of the total transaction.

Second, how to monitor key indicators?

Ø   resource monitoring indicators

The main monitor resource usage for each server platforms (Windows, Linux, Unix, etc.).

Can use the system's own performance monitoring tools monitor or third-party tools, such as the Windows system comes "System Performance Monitor", as shown below:

Linux system, free, vmstat, sar, iostat commands to monitor memory, CPU, disk usage, etc. IO, as shown below:

Third-party monitoring tools such as spotlight, spotlight is a visualization tool developed by a quest can be monitored for a variety of platforms and database systems, as shown below:

Nmon is monitoring AIX and Linux system resources free tools provided by IBM, can resource information collected by statistical analysis of the formation of intuitive Excel chart, as shown below:

Ø   system monitoring indicators

系统指标监控一般通过性能测试工具(如LoadRunner、Jmeter等)以图形化方式监控,如下图所示,并发用户数与平均响应时间关系图。

三、如何分析监控的关键指标?

通过第二部分监控收集到性能度量关键指标,如何进行分析,并判断是否存在性能瓶颈呢?以下主要从资源指标与系统指标两方面进行阐述。

Ø   资源指标分析

判断CPU是否是瓶颈的方法:一般情况下CPU满负荷工作,有时候并不能判定为CPU出现瓶颈,比如Linux 总是试图要CPU尽可能的繁忙,使得任务的吞吐量最大化,即CPU尽可能最大化使用。因此,一般判断CPU为瓶颈,主要从两方面:一是CPU空闲持续为 0,二是运行队列大于CPU核数(经验值3-4倍),即可判定存在瓶颈,对于CPU高消耗主要由什么引起的,可能是应用程序不合理造成,也可能是硬件资源 不足,需要具体问题具体分析,比如问题SQL语句引起,则需要跟踪并优化引起CPU使用过高的SQL语句。

判断内存是否是瓶颈的方法:一般至少有10%可用内存,内存使用率可接受上限为85%。当空闲内存变小时,系统开始频繁地调动磁盘页面文件,空闲内存过小可能是内存不足或内存泄漏引起,需要根据系统实际情况监控分析。

判断磁盘I/O是否是瓶颈的方法:磁盘I/O对于数据库服务器、文件服务器、流媒体服务器系统来说,更容易成为瓶颈,一般从以下几个方面对磁盘I/O进行分析判断:

①    计算每磁盘I/O数

每磁盘I/O数可用来与磁盘的I/O能力进行对比,如果经过计算得到的每磁盘I/O数超过了磁盘标称的I/O能力,则说明确实存在磁盘的性能瓶颈,每磁盘I/O计算方法如下表:

RAID类型

计算方法

RAID0

(Reads+Writes)/Numbers of Disks

RAID1

(Reads+2*Writes)/2

RAID5

[Reads+(4*Writes)] /Numbers of Disks

RAID10

[Reads+(2*Writes)] /Numbers of Disks

②    监控磁盘读写,如果磁盘长时间进行大数据量读写操作,且cpu等待超过20%,则说明磁盘I/O存在问题,考虑提高磁盘I/O读写性能。

判断网络带宽是否是瓶颈的方法:判断网络带宽是否是系统运行性能瓶颈的首要条件是网络带宽是否会影响系统交易执行性能。例如:减小网络带宽,并发用户数、响应时间与事务通过率等性能指标是否不能接受;或者增加网络带宽,并发用户数、响应时间与事务通过率等性能指标会得到明显提高。

在实际性能测试中,如果发现始终报连接超时,而实际手工访问可以正常访问,可以通过ping应用服务器IP或网关IP,如果出现网络严重延迟或丢包,则说明网络不稳定,需要检查网络。

通过对资源指标四个指标的分析,实际上各个方面都是互相依赖的,不能孤立的单从某个方面进行排查。当一个方面出现性能问题时,往往会引发其他方面的 性能问题,例如,大量的磁盘读写势必消耗CPU和IO资源,而内存的不足会导致频繁地进行内存页写入磁盘、磁盘写到内存的操作,造成磁盘IO瓶颈,同时, 大量的网络流量也会造成CPU过载,所以,在分析性能问题时,需要从各个方面进行考虑。

Ø  系统指标分析

并发用户数:系统能够支持的用户数是系统容量的重要标志,并发用户数用于度量系统在高并发量访问下,系统的并行处理能力,一般如果系统中存在死锁、资源争用,在并发访问下,由于请求处于队列等待中,系统响应就会随着时间变慢。

一般情况下,选用高吞吐量、高数据库I/O、高商业风险的业务功能进行并发用户访问测试。

判断系统能够承受的最大并发用户数,通常以满足以下条件为准:

1、业务功能操作平均响应时间在合理范围之内

2、事务成功率在合理范围之内

3、 系统运行无故障(无异常宕机)

4、系统资源指标使用在合理范围内

平均响应时间:对于客户端用户来说,最直观的体验就是访问该页面快或者慢,即响应时 间的长短。比如在持续并发性能测试过程中,客户感知访问应用很慢,监控到的平均响应时间也逐渐变长,这时就需要先借助于监控到的资源指标,首先排除资源方 面的限制因素,再从应用本身进行定位,如可以采用页面细分工具(如httpwatch、Loadrunner Anaysis中的页面组件细分)分析响应比较慢的页面。

事务成功率、超时出错率:事务成功率越高,则表明系统处理能力越大;而失败事务主要由于系统响应慢,导致访问业务功能超时,或者系统业务功能异常,不能正常访问等,需要根据事务错误提示信息,具体分析。

Guess you like

Origin www.cnblogs.com/dangkai/p/10942532.html