LoadRunner监控Window/Unix系统资源的配置
(2011-01-18 10:25:33) 标签: loadrunner监控window/unix | 分类: 04性能测试 |
LoadRunner监控Window/Unix系统资源需要做两件事情:
1、配置被监视的服务器,以便于LoadRunner能够获取系统资源使用情况的数据
2、在LoadRunner的Controller中添加计数器
添加计数器比较简单,这里主要讲如何配置Window/Unix服务器。
一、配置UNIX系统:
1、修改/etc/xinetd.d/下的三个conf文件rlogin,rsh,rexec这三个配置文件,把这三个文件里的disable = yes都改成disable = no(disabled用在默认的 {} 中禁止服务),或是把#default:off都设置成on这个的意思就是在xinetd启动的时候默认都启动上面的三个服务。
2、执行:rpc.rstatd
3、检查是否启动rstatd,输入命令:rpcinfo–p。如果能看到:
程序 版本 协议 端口
那就说明rstatd服务启动了
4、LR中添加计算器
如果系统没有安装rstatd的话,上面的操作将会不成功,需要先安装rstatd,安装rstatd过程很简单:
(1)从安装光盘或网上找到安装文件(一般是rstatd***.tar.gz)
(2)解压缩安装包:
tar xzvf rstatd***.tar.gz
(3)进入源文件目录运行配置文件和编译:
$./configure $ make $ makeinstall |
安装好之后,就按上面的步骤启动rstatd即可。
(说明:以上的操作需要root用户权限)
二、配置window系统
一般在客户端通过LoadRunner对服务器进行压力测试,都需要实时监控服务器端的系统资源,本篇主要简单介绍一下如何设置在 LoadRunner的Controller中配置监控Windows Resources,其实也可以直接在远程连接服务器端在上面开启任务管理器或者在控制面板中找到性能计数器来监控也可以,但是为了在LR进行施压过程中 更便捷,我们还是要学会这个基本的配置。关于此处的配置,需要针对不同的服务器操作系统进行不同的设置,但基本思路相同。本篇以Windows系统为例, 具体配置如下:
1、通过客户端与服务器进行网络测试,保证通信畅通
2、保证被监视的windows系统开启以下二个服务:Remote Procedure Call(RPC)和Remote Registry Service如下图:
3、需要对服务器的系统本地策略进行更改,这个很重要,也是决定客户端能不能访问服务器端的关键步骤,具体需要进入控制面板下的管理工具中,找到本地安全策略,如下:
注意:这里一定要改成经典模式,默认为仅来宾模式。
4、在客户端进行测试,在“运行”栏中输入服务器的ip地址,后面跟上C$,表示服务器C盘下的系统资源目录, 如:“\\192.168.96.135\C$”,看看是否可以访问服务器C盘目录,通常情况下可能需要输入用户名和密码,填充服务器端的账户和密码就 ok,如下所示:
注:如果显示可以访问该页面表示,可以正常访问服务器端的系统资源,也就可以监控。
5、切换到LoadRunner的Controller中在Windows Resources下配置监控目标,具体如下:
通过上图发现,这种配置方式跟系统的性能计数器配置基本类似。
6、看看配置完成后的实时监控记录,如下图所示:
以上是在压力测试过程中,所实时监控的目标服务器的系统资源。
在Controller的场景监控界面里面的Windows Resources上面点右键Add Measuremens然后添加要监控主机的IP地址(Add Machine)就行了。
在添加主机的下面就是监控的各项参数,下表就是各项参数对应的监视内容。
Object | Measurement | Description |
System | % Total Processor Time | The average percentage of time that all the processors on the system are busy executing non-idle threads. On a multiprocessor system, if all processors are always busy, this is 100%, if all processors are 50% busy this is 50% and if 1/4 of the processors are 100% busy this is 25%. It can be viewed as the fraction of the time spent doing useful work. Each processor is assigned an Idle thread in the Idle process which consumes those unproductive processor cycles not used by any other threads. |
System | File Data Operations/sec | The rate at which the computer issues read and write operations to file system devices.This does not include File Control Operations. |
Processor | % Processor Time (Windows 2000) | The percentage of time that the processor is executing a non-idle thread. This counter was designed as a primary indicator of processor activity. It is calculated by measuring the time that the processor spends executing the thread of the idle process in each sample interval, and subtracting that value from 100%. (Each processor has an idle thread which consumes cycles when no other threads are ready to run). It can be viewed as the percentage of the sample interval spent doing useful work. This counter displays the average percentage of busy time observed during the sample interval. It is calculated by monitoring the time the service was inactive, and then subtracting that value from 100%. |
System | Processor Queue Length | The instantaneous length of the processor queue in units of threads. This counter is always 0 unless you are also monitoring a thread counter. All processors use a single queue in which threads wait for processor cycles. This length does not include the threads that are currently executing. A sustained processor queue length greater than two generally indicates processor congestion. This is an instantaneous count, not an average over the time interval. |
Memory | Page Faults/sec | This is a count of the page faults in the processor. A page fault occurs when a process refers to a virtual memory page that is not in its Working Set in the main memory. A page fault will not cause the page to be fetched from disk if that page is on the standby list (and hence already in main memory), or if it is in use by another process with which the page is shared. |
PhysicalDisk | % Disk Time | The percentage of elapsed time that the selected disk drive is busy servicing read or write requests. |
Memory | Pool Nonpaged Bytes | The number of bytes in the nonpaged pool, a system memory area where space is acquired by operating system components as they accomplish their appointed tasks.Nonpaged pool pages cannot be paged outto the paging file. They remain in main memory as long as they are allocated. |
Memory | Pages/sec | The number of pages read from the disk or written to the disk to resolve memory references to pages that were not in memory at the time of the reference. This is the sum of Pages Input/sec and Pages Output/sec. This counter includes paging traffic on behalf of the system cache to access file data for applications. This value also includes the pages to/from non-cached mapped memory files. This is the primary counter to observe if you are concerned about excessive memory pressure (that is,thrashing), and the excessive paging that may result. |
System | Total Interrupts/sec | The rate at which the computer is receiving and servicing hardware interrupts. The devices that can generate interrupts are the system timer, the mouse, data communication lines, network interface cards, and other peripheral devices. This counter provides an indication of how busy these devices are on a computer-wide basis. See also Processor:Interrupts/sec. |
Objects | Threads | The number of threads in the computer at the time of data collection. Notice that this is an instantaneous count, not an average over the time interval. A thread is the basic executable entity that can execute instructions in a processor. |
Process | Private Bytes | The current number of bytes that the process has allocated that cannot be shared with other processes. |