loadrunner跑場景的時候出現:Abnormal termination, caused by mdrv process termination
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.
原文地址:http://loadrunner.wetpaint.com/page/Abnormal+termination,+caused+by+mdrv+process+termination
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.解決方案
根據上述的資料,首先關閉了擴展日志,然后加入了思考時間,並且減少了單個壓力機上虛擬用戶,轉而由多個壓力機一起運行腳本。此問題解決。