51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2047|回复: 0
打印 上一主题 下一主题

[转贴] loadrunner跑场景的时候出现:Abnormal termination, caused by mdrv process term...

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2019-2-18 16:17:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1.问题

loadrunner跑场景的时候出现:Abnormal termination, caused by mdrv process termination。

备注:我使用的是RTE协议录制的脚本。


2.一些资料2.1关于mdrv.exe意外终止的可能出现情况说明

Hi, Users facing this mdrv process abnormal termination can try one of these options found from one of the LR articles. The Loadrunner vusers are run by a process called 'mdrv.exe'. Whenever this process encounters errors due to various reasons it may terminate. Some of the possible reasons are as follows

  •     The Host machine ( Load generator) is running too many Vusers as a result of which it system resources are being maximized. ( i.e. Consistent over 90% CPU and Memory utilization). The mdrv process does not get enough resources to process the request as a result it fails
  •     If you have Custom C coding, there is a possibility of allocated memory not being freed or memory violation errors which can lead to 'mdrv process termination'.
  •     Replay the script with think time.
  •     Turn off extended log when running the script in the controller.
  •     Do not use the controller itself as the loadgenerator. i.e. have a remote LoadGenerator.
  •     Introduce iteration pacing, if running more than one iteration each vuser.
  •     Open the file C:\WinNT\wlrun7.ini in a text editor, modify the entry from: AgentMaxThreadsPerDriver=50 to AgentMaxThreadsPerDriver=20 or 10
  •     Run Agent as process instead of service Launch command prompt and navigate to C:\Program Files\Mercury\Loadrunner\Launch_service\bin and run the command magentserive -remove. This will remove the agent. Now run the command magentproc -install This will install the agent as a process.
  •     Run vusers as process instead of threads.Please go to Runtime Settings > Miscellaneous > Multithreading > RunVuser as a process.

2.2 mmdrv和mdrv的异同

在LoadRunner运行脚本过程中,在任务管理器中我们可以看到有一个或多个名为“mmdrv”的进程在运行,与此同时当我们查看 LoadRunner/bin目录下的文件时还会看到一个“mdrv.exe”文件,那么mmdrv.exe和mdrv.exe有什么异同?
      

其实mmdrv是mdrv的封套,mmdrv通常应用于一些协议(例如 web http/html)中对内存进行优化应用,但实质上mmdrv在优化内存时会启动mdrv。二者都可以按以下命令格式来启动并运行测试脚本:mmdrv/mdrv  -usr  <script path>
      

例如在windows的command窗口中首先切换目录至LoadRunner的bin目录下,然后运行以下命令:
>mmdrv -usr  D:/qa/product/Space/project/space-3.0.1/performancetest/script/firstpage/script_loadfirstpage/script_loadfirstpage.usr  


这样脚本就会在后台运行(不会启动LoadRunner control界面,但可以在任务管理器中看到mmdrv进程运行情况),运行结果可查看脚本目录中的日志文件,如:output.txt,mdrv*.xxx.log(其中“*”是不同的字符标识,如Q6n、R5u;“xxx”是数字代码,如229、505)。


mmdrv和mdrv使用的更多说明可在command窗口中LoadRunner/bin目录下启动mmdrv或mdrv,可看到如下说明(注意到:不论是输入mmdrv还是输入mdrv,显示的帮助窗口都是mdrv的说明内容,这更说明了mmdrv是对mdrv的包装):


2.3 Loadrunn中的多线程与多进程

Loadrunner支持多线程环境,使用多线程的方法能使每台负载生成器运行更多的VU,但是只有支持线程安全的协议,才能使用Loadrunner的VU并发方式。

以下协议不能支持线程并发

Sybase-Dblib,Infomix,Tuxedo,and PeopleSoft-Tuxedo

当使用进程并发是,在任务管理器中有mdrv.exe的进程,比如下图,用10个VU用户并发,就会在任务管理器中出现10个mmdrv进程

如果以多线程方式并发,只会出现一个mmdrv进程,一个进程可以支持50VU的线程并发。

Loadrunner的参考帮助还说明了,如果采用多线程方式并发,Load Generator将会比多进程支持更多的用户,具体的一个VU占用内存的取值根据Loadrunner的版本不同而不同。


3.解决方案

根据上述的资料,首先关闭了扩展日志,然后加入了思考时间,并且减少了单个压力机上虚拟用户,转而由多个压力机一起运行脚本。此问题解决。


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-4-25 03:15 , Processed in 0.064643 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表