Swingbench is a Java based load generator for Oracle. Swingbench can be used to perform stress testing. The Swingbench package can be downloaded from here: http://www.dominicgiles.com/downloads.html.
Swingbench is a versatile tool in that in does not always need to be used for load generation. It can be used as an effective way to validate Oracle RAC configurations. It can be used to test new Oracle software or patches. And it can also assist in evaluating Oracle new features — like the upcoming 12c release.
Swingbench Load-generating tests
Swingbench has several load-generating tests available, including:
- OE (Order Entry) – It behaves like an OLTP application. It is designed to stress a few number of tables and the RAC interconnect if it exists.
- SH (Sales History) – SH is more of a data warehouse application running complex queries against large tables. It is noted on the Swingbench website that the schema can be further customized for different data layouts.
- CC (Calling Circle) – This is designed to stress test SQL generated from an application. The application is reportedly CPU intensive, especially during the load generator.
- The last test is called StressTest. Its simplistic design does random selects, updates, and inserts.
We often use Swingbench for Capacity Threshold Testing (CTT). What is CTT? CTT is benchmarking designed to test the capacity of your hardware or vSphere cluster. With our CTT test, Swingbench is actually not used to take benchmark metrics — instead it is used to generate a load. We do this by starting Swingbench nodes and then running benchmarks (like Linux dd), taking measurements, and we increase the number of Swingbench nodes.
To run this type of test you need to first download and setup Swingbench.
- Download Swingbench 2.4 from http://www.dominicgiles.com/downloads.html.
- Swingbench 2.4 requires Java 6 or higher.
- Unzip the swingbench zip file in the desired directory.
- Seed the OE data by starting the oewizard application located in the $SWINGBENCH/bin directory, the oewizard is a GUI java application so X Windows is required.
Figure 1 – OE Install Wizard
Figure 2 – OE Wizard (Select Task)
Figure 3 – OE Wizard (Database Details)
Figure 4 – OE Wizard (Schema Details)
Figure 5 – OE Wizard (Sizing Details)
Figure 6 – OE Wizard (Parallelism)
After seeding the data, we edit the connection configuration file. The file contains, among other things, the username and password for the schema owner and connection string for the database. In our configuration, the connection string will be the only item we need to edit. In Figure 7 we have highlighted the connection string. The string is on line 8 in the file. Because Swingbench is running from the database host, we can leave localhost as the hostname. If this is not the case, change accordingly. The other item we need to supply is the database name.
Figure 7 – Edit soeconfig.xml
This completes the Swingbench setup. The load generating tool is now ready to begin testing using charbench—the Swingbench command client used for load generation. To begin using charbench:
- Log in as the oracle user to the virtual machine.
- Set the Oracle environment.
- Navigate to the Swingbench home and cd into the bin directory.
- Run the command:
Note: soeconfig.xml is the file we edited in the section above.
Notice that we asked charbench to output the following metrics: users (number of users), tpm (transactions per minute), tps (transactions per second), cpu (% of CPU used), and disk (bytes in and bytes out). See Figure 8 for sample output.
Figure 8 – Charbench Output
by Jim Hannan ( @HoBHannan), Principal Architect