Command Line Options...


Most of swingbench's parameters can be changed from the command line. That is to say, the swingconfig.xml file (or the other example files in the sample directory) can be used as templates for a run and each runs parameters can be modified from the command line. The -h option lists command line options
[dgiles@macbook-2 bin]$ ./charbench -h
usage: parameters:
 -D <variable=value>   use value for given environment variable
 -a                    run automatically
 -be <stopafter>       end recording statistics after. Value is in the
                       form hh:mm
 -bs <startafter>      start recording statistics after. Value is in the
                       form hh:mm
 -c <filename>         specify config file
 -co <hostname>        specify/override coordinator in configuration file.
 -com <comment>        specify comment for this benchmark run (in double
                       quotes)
 -cpuloc <hostname >   specify/overide location of the cpu monitor.
 -cs <connectstring>   override connect string in configuration file
 -debug                turn on debug output
 -di <shortname(s)>    disable transactions(s) by short name, comma
                       separated
 -dt <drivertype>      override driver type in configuration file (thin,
                       oci, ttdirect, ttclient)
 -en <shortname(s)>    enable transactions(s) by short name, comma
                       separated
 -h,--help             print this message
 -i                    run interactively (default)
 -ld <milliseconds>    specify/overide the logon delay (milliseconds)
 -max <milliseconds>   override maximum think time in configuration file
 -min <milliseconds>   override minimum think time in configuration file
 -p <password>         override password in configuration file
 -r <filename>         specify results file
 -rr                   specify/overide refresh rate for charts in secs
 -rt <runtime>         specify/overide run time for the benchmark. Value
                       is in the form hh:mm
 -s                    run silent
 -u <username>         override username in configuration file
 -uc <number>          override user count in configuration file.
 -v <options>          display run statistics (vmstat/sar like output),
                       options include (comma separated no spaces).
                       trans|cpu|disk|dml|tpm|tps|users
The following examples show how this functionality can be used

Example 1.

$ > ./swingbench -cs //localhost/DOM102 -dt thin
Will start swingbench using the local config file (swingconfig.xml) but overriding its connectstring and driver type. All other values in the file will be used.

Example 2.

$ > ./swingbench -c sample/ccconfig.xml -cs //localhost/DOM102 -dt thin
Will start swingbench using the config file sample/ccconfig.xml and overriding its connectstring and driver type. All other values in the file will be used.

Example 3.

$ > ./minibench -c sample/soeconfig.xml -cs //localhost/DOM102 -dt thin -uc 50 -min 0 -max 100 -a
Will start minibench (a lighter weight frontend) using the config file sample/ccconfig.xml and overriding its connectstring and driver type. It also overrides the user count and think times. The "-a" option starts the run without any user interaction.

Example 4.

$ > ./charbench -c sample/soeconfig.xml -cs //localhost/DOM102 -dt thin -cpuloc oraclelinux -uc 20 -min 0 -max 100 -a -v users,tpm,tps,cpu
Author  :     Dominic Giles
Version :        2.3.0.344

Results will be written to results.xml.

Time            Users   TPM     TPS     User    System  Wait    Idle
5:08:19 PM      0       0       0       0       0       0       0
5:08:21 PM      3       0       0       4       4       3       89
5:08:22 PM      8       0       0       4       4       3       89
5:08:23 PM      12      0       0       4       4       3       89
5:08:24 PM      16      0       0       8       43      0       49
5:08:25 PM      20      0       0       8       43      0       49
5:08:26 PM      20      2       2       8       43      0       49
5:08:27 PM      20      29      27      8       43      0       49
5:08:28 PM      20      49      20      53      34      1       12

Will start charbench (a character based version of swingbench) using the config file sample/ccconfig.xml and overriding its connectstring and driver type. It also overrides the user count and think times. The "-a" option starts the run without any user interaction. This example also connects to the cpumonitor (started previously). It uses the -v option to continually display cpu load information.

Example 5.

$ > ./minibench -c sample/soeconfig.xml -cs //localhost/DOM102 -cpuloc localhost -co localhost
Will start minibench using the config file sample/ccconfig.xml and overriding its connectstring. It also specifies a cpu monitor started locally on the machine and attaches to a coordinator process also started on the local machine.

Example 6.

$ > ./minibench -c sample/soeconfig.xml -cs //localhost/DOM102 -cpuloc localhost -rt 1:30
Will start minibench using the config file sample/ccconfig.xml and overriding its connectstring. It also specifies a cpu monitor started locally on the machine. The "-rt" parameter tells swingbench to run for 1 hour 30 and then stop.

Example 7.

$ > ./coordinator -g
$ > ssh -f node1 'cd swingbench/bin;swingbench/bin/cpumonitor';
$ > ssh -f node2 'cd swingbench/bin;swingbench/bin/cpumonitor';
$ > ssh -f node3 'cd swingbench/bin;swingbench/bin/cpumonitor';
$ > ssh -f node4 'cd swingbench/bin;swingbench/bin/cpumonitor';
$ > ./minibench -cs //node1/RAC1 -cpuloc node1 -co localhost &
$ > ./minibench -cs //node2/RAC2 -cpuloc node2 -co localhost &
$ > ./minibench -cs //node3/RAC3 -cpuloc node3 -co localhost &
$ > ./minibench -cs //node4/RAC4 -cpuloc node4 -co localhost &
$ > ./clusteroverview

In 2.3 the loadgenerators can use the additional command line option -g to specify which load generation group they are in i.e.
$ > ./minibench -cs //node1/RAC1 -cpuloc node1 -co localhost -g group1 &

This collection of commands will first start a coordinator in grpahical mode on the local machine. The next 4 commands secure shell to the 4 nodes of a cluster and start a cpumonitor (swingbench needs to be installed on each of them). The following commands start four load generators with the minibench front end each referencing the the cpumonitor started on each database instance, they also attach to the local coordinator. Finally the last command starts clusteroverview (currently its configuration needs to be specified in its config file). Its possible to stop all of the load generators and coordinator with the following command
$ > ./coordinator -stop