LoadRunner mmdrv.exe iconIf you are running LoadRunner scripts from the command line using mmdrv.exe, then you will know that mmdrv.exe has a large number of command line options.

Unfortunately, the options are not really documented apart from what is displayed in the user interface. Read on for some hints…

To see the command line options, run the mmdrv executable:

C:\Program Files\HP\LoadRunner\bin>mmdrv.exe

…and the following window is displayed:

LoadRunner mmdrv.exe options window

The mmdrv command line options are:

User options:
 -usr <usr file>
 [-file <binary file (.ci or .dll)>]
 [-out <output directory>]
 [-threads | -threads <number of threads>]
 [-lr_view (WIN32 only, show UI)]
 [-sensitivity <0,9> (low/high responsive vuser under controller)]
 [-parent_pid <process id>]
 [-extra_ext <extra extension entry name>]
 [-version (return the version number)]
 [-no_exception (run without exception handling)]
 [user parameters]
Debug options:
 [-no_drv_log (disable creation of log file)]
 [-drv_log_flush (commit log file buffer on every message)]
 [-drv_msg (popup message/write to stderr on every error)]
 [-drv_log_file (your log file path, if not set driver generates another)]
 [-drv_time_prefix <prefix every message with current time>]
 [-msg_suffix_enable <0,1>] (disable/enable messages suffixes)
Interpreter Options:
 [-compile_flags <compile-flags filename>]
 [-cci_stack <CCI stack size> (default 8192)]
 [-cci_debug (activate CCI debug)]
 [-cci-trace (activate CCI trace)]
 [-cci_disable_event (use event callbck)]
 [-cci_elevel (force every line CB)]
Agent options:
 -magic <session magic>
 -script_id <logical name>
 -drvprognum <unique program number for the driver RPC server>
 -brprognum <the program number of the agent server> (why is this duplicated?)
 -mtminver <minimal driver version number supported>
 -mtmaxver <maximal driver version number supported>
Log File Backup options:
 -mdrv_log_type <append or truncate log file on open>
 -drv_log_backup_mode <backup log file on_open or on_maxsize or compress>
 -drv_log_size <log file size in KB>
 -drv_log_backup_duration <duration in h for backup files to live>
 -drv_backup_path <optional dir for backup files>
 -drv_log_cnfg_backup_file <cnfg file path that holds backup info>
 -drv_log_shared <logging from several processes 2 same log file>
 -drv_log_prefix_procid <add proc id prefix to each message>
 -drv_use_link_group_flag <Use RTLD_GROUP with dlopen, active on solaris>
 -drv_log_dynamic_update <No value Needed, opens dynamic update timer in logger>

If you are just going to be running a single virtual user from the command line, you probably only need:

C:\Program Files\HP\LoadRunner\bin>mmdrv.exe –usr “C:\_LoadRunner\Scripts\my_example_script\my_example_script.usr” -drv_log_file "C:\_LoadRunner\Logs\output.txt"

What does the Controller run?

When the LoadRunner Controller runs a test, the Agent on the load generator will start one or more mmdrv.exe processes (depending on how many virtual users are running in the test – by default, there are 50 web vusers per mmdrv process when running virtual users as a thread).

The mmdrv.exe process is invoked with something like this…

C:\Program Files\HP\LoadRunner\bin\mmdrv.exe -f "C:\Users\IEUser\AppData\Local\Temp\brr_Gg3.858\do_nothing_20170107_012\process_mdrv_cmdln.prm"

You will note that it is using the undocumented “-f” option that reads all of the other options from a file. The process_mdrv_cmdln.prm file contains something like this…

-usr "C:\_LoadRunner\Scripts\do_nothing_20170107_01\do_nothing_20170107_01.usr" 
-controllerhost "IE8Win7" 
-verify "c:\_loadrunner\results\do_nothing_20161101_01\log" 
-working_lang 0 
-cfgpp "C:\Users\IEUser\AppData\Local\Temp\lr5tmpdirrSr.854\lrcfgLMd.855\cfgIe8.856" 
-lnch_priority below_normal 
-param_non_working_days "6,7" 
-param_log_timestamp_flag "0" 
-lnch_mdrv_based "(-server_type=2)(-server_name=lrchan1_3052)" 
-lnch_flags 131075 
-launcher_moniker 5 
-temp_dir "C:\Users\IEUser\AppData\Local\Temp\brr_Gg3.858\do_nothing_20170107_015"  
-globaldir_path "C:\Users\IEUser\AppData\Local\Temp\brr_Gg3.858\global_dir"    
-parent_pid 2012 
-lnch_time_out_hb 15000  
-lnch_time_out_try_hb 4    
-lnch_pre_err_file "C:\Users\IEUser\AppData\Local\Temp\brr_Gg3.858\do_nothing_20170107_015\pre_error_msgs_file15" 
-lnch_post_err_file "C:\Users\IEUser\AppData\Local\Temp\brr_Gg3.858\do_nothing_20170107_015\post_error_msgs_file15"

You will note that some of the options in the process_mdrv_cmdln.prm file are not displayed in the mmdrv.exe options window (more undocumented options!).

Are mmdrv.exe and mdrv.exe the same?

Note that there is another file called mdrv.exe (rather than mmdrv.exe) in the same folder as mmdrv.exe. Invoking mdrv.exe shows the same window of command line options, but it is definitely not the same file with a different name. I do not know what the purpose of mdrv.exe is, but it seems like a bad idea to use it.

C:\Program Files\HP\LoadRunner\bin>dir *mdrv.exe
 Volume in drive C has no label.
 Volume Serial Number is E0CE-337D

 Directory of C:\Program Files\HP\LoadRunner\bin

04/21/2016  04:00 PM            31,648 cmdrv.exe
04/21/2016  04:12 PM            18,336 mdrv.exe
04/21/2016  04:13 PM            31,648 mmdrv.exe
               3 File(s)         81,632 bytes
               0 Dir(s)  117,774,446,592 bytes free

C:\Program Files\HP\LoadRunner\bin>


Published On: January 7, 2017Tags: ,