Simple Benchmark
Swingbench is driven off a simple XML file that describes the connections and load that the load generator will place on a database. This file can be trivially overwritten from the command line allowing for quick testing and batch runs. This file is called swingconfig.xml and is typically located in the bin directory of the swingbench home. It can be edited with any standard text editor and for the whole most fields should be self explanatory. The swingbench tool will also save any changes you make to this file.
Swingbench has three front ends
- Swingbench - A rich graphical front end ideal for demonstrations
- Minibench - A lighter weight graphical front end useful for testing over remote connections
- Charbench - A character mode front end useful for data collection and batch runs
All of the front ends use the same configuration files and exhibit the same functionality.
To assist in the creation of the default benchmarks, callingcircle and order entry, swingbench ships with two wizards which step the user through the process of creating, dropping and in the case of the callingcircle benchmark generating data for each run. We'll use the "Simple Order Entry" benchmark to demonstrate how to set up and run a simple load on a sinlge instance database. The orderentry wizard can be launched from the $SWINGHOME/bin (or $SWINGHOME/winbin for windows) directory using the following command
[oracle@dgiles-uk bin]$ ./oewizard
As with the swingbench load generator the the wizards use xml configuration files to maintain a persistent record of a users/database settings for a benchmark. The author recommends that users modify these files to reflect their own configuration. From version 2.1f of swingbench users can run the wizards in character mode. This is achieved by changing the “Mode” attribute from “InterActive” to “LightsOut”. In character mode the wizard is driven entirely of the configuration file. The users can change the “operation” attribute to one of three values “create”, “drop” and “generate” to respectively either create a benchmarks schema, drop a existing schema or in the case of the callingcircle benchmark generate data for a new benchmark run.
If the oewizard is launched in graphical mode the following window will appear
Press next and select the “Create the Order Entry Schema”.
Press next again and enter the details of the database in which you wish to create the the benchmark schema. Specify a user with DBA privileges. Press next again. In this dialogue enter the details of the the schema, tablespaces and datafiles that will be used to hold the tables. NOTE : If you’re using Oracle ASM you only need to specify the name of the storage group for the datafile i.e. “+DATA”. If you've previously created a tablespace or simply wish to use and existing one you can select it from the drop down box. If you've licensed or are evaluating partitioning check the "Use partitioning?" checkbox, this can improve performance at very high transaction rates or when Real Application Clusters are being used.
Press next again. The following dialogue allows the user to specify the size of the benchmark. Users can increase or decrease the number of customers and orders value by moving the sliders (increases logarithmically). The size and time to complete are estimates are shouldn't be relied on.
Press next again and next one final time and press finish to begin the creation process.
After the wizard has completed it is now possible to use swingbench, minibench or charbench to generate a load against the database. To start a loadgenerator in Unix/Linux type the following command
[oracle@dgiles-uk bin]$ ./swingbench
NOTE : Running swingbench remotely over X will generate a significant network load because of regular chart refreshes.
In Windows simply type the following command within the winbin directory (or double click on swingbench.bat)
[C:\ > swingbench.bat
This will launch the following window
Change the username,password and connect string to reflect your environment. The connect string is of the form
Thin (pure java) | //< |
OCI (java callout to Oracle's oci layer) | //< |
NOTE : Make sure the drop down box for connection type is set to the appropriate type of connection
The "Configuration" dialogue enables you to change all of the important attributes that control the size and type of load you place on your server. Four of the most useful are
- User Count : This describes the number of sessions that swingbench will create against the database. This is value a typically between one and a thousand. Whilst a large number may be useful in some circumstances it should be used with caution. It is only realistic when used in conjunction with a large database and big think times.
- Min and Max Think Time : These values control how long swingbench will put a session to sleep between transactions. This simulates natural pauses caused by key stokes, mouse navigation etc. The values are measured in milliseconds and can be between 0 and hours, swingbench will create a random value between these two settings. If the Max Think Time is less the Min Think Time swingbench will assume a value of 0. A value of zero for both Min and Max Think Times will cause swingbench to run transaction as fast as possible against the database.
- Run Time : This is the total time swingbench will run the bench for. After this time has expired swingbench will automatically log off the sessions. This is especially useful for rerunning benchmarks inside of a batch routine to do comparisons of different load profiles.
Once a user is happy with the settings they can be saved by clicking on the icon or selecting save from the menu. Pressing the will start logging the users on and begin generating the load. Whilst a load is running the user can change the chart that is being displayed from the "Chart Type" drop down box. This enables users to monitor features such as response times and CPU load (if monitored) on database under stress. An example is shown below of the real time response times chart.
The benchmark run will come to an end when the icon is pressed or the "Run Time" expires. The results of the run will be shown in the "Output" tab.