loadrunner11 報Abnormal termination, caused by mdrv process termination的解決方法.
轉自:http://loadrunner.wetpaint.com/page/Abnormal+termination,+caused+by+mdrv+process+termination
f the LR articles. The Loadrunner vusers are run by a process called 'mdrv.exe'. Whenever this process encounters errors
- 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.
另外,注意下負載機的連線數是否過高,往往測試TPS較高的應用或是Client本身導致連線來不及釋放會引起mmdrv程序Crash。當然加入Thinktime或者Pacing Time是種辦法,一般最小可設定0.1~1s,但畢竟指標不治本,需要更多的使用者來測試系統最大處理能力。
-------------------------
問題,LR對webservice的某個介面執行少量併發數的場景時,controller出現Abnormal termination, caused by mdrv process termination.大量錯誤,導致執行緒終止了請求,但伺服器和負載機的資源都屬正常。
解決方法和思路:為了解決此問題,查閱了網上較多資料和官網解釋,大同小異,也進行一一嘗試,最終無果,但意外發現資料中,除了一些引數設定修改以外,其中有條非常特別解釋:“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”(這裡大概的意思是:負載機的資源已經達到瓶頸,且無法接收響應回來的資料,導致process終止),於是萌生猜想,是不是伺服器中資料庫和tomcat之間出現了什麼異常,導致資料無法響應給客戶端,但按照常理,如果此兩者出現異常,應該也是會相應http狀態碼返回客戶端的,但非常異常的是controller只出現大量執行緒終止錯誤,為了驗證此時的矛盾,於是請求開發協助,並在此介面的可能出現問題的地方加上相應日誌,執行後,不出意料,結果正如我們的猜想,可能是資料庫由於負載壓力過大,導致了資料庫與tomcat之間連線異常,tomcat卻將異常資訊返回給客戶端,而客戶端卻無法識別響應,導致了controller出現執行緒終止的情況,為了解決此問題,開發修改了程式,將成功的請求就返回一個整型1,失敗或異常請求就返回一個整型0,經過多次實踐驗證執行,都未出現上述執行緒終止的問題了。
---------------------------修改了
LR
中的
D:\Program
Files\Mercury\LoadRunner\dat\protocols
中的
http.lrp
資訊,
在
[Vugen]
下面新加一條
MaxThreadPerProcess=
要設定的
vuser
數量
。