Swingbench Installation and Setup

by | Jun 20, 2013 | Oracle | 6 comments

by Jim Hannan ( @HoBHannan), Principal Architect

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 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.

  1. Download Swingbench 2.4 from http://www.dominicgiles.com/downloads.html.
  2. Swingbench 2.4 requires Java 6 or higher.
  3. Unzip the swingbench zip file in the desired directory.
  4. 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.

Swingbench_applicationwizard_1

Figure 1 – OE Install Wizard

Swingbench_oeinstallwizard_2

Figure 2 – OE Wizard (Select Task)

Swingbench_selecttask_3

Figure 3 – OE Wizard (Database Details)

Swingbench_databasedetails_4

Figure 4 – OE Wizard (Schema Details)

Swingbench_schemadetails_5

Figure 5 – OE Wizard (Sizing Details)

Swingbench_sizingdetails_6

Figure 6 – OE Wizard (Parallelism)

Swingbench_parallelism_7

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

Swingbench_editsoeconfig_8

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:

  1. Log in as the oracle user to the virtual machine.
  2. Set the Oracle environment.
  3. Navigate to the Swingbench home and cd into the bin directory.
  4. Run the command:

Swingbench_charbenchcommand_9

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

Swingbench_charbenchoutput_10

This is just one of the many uses for Swingbench. If you have questions or comments, I can be reached via Twitter @HoBHannan.

To find out more about what House of Brick can do for you, visit our Services page.

6 Comments

  1. How I can to monitor transactions for another schema configurated in my oracle database. I have to edit the file swingbench.xml with parameters and values to my schema?

    Regards!

    Reply
    • I talked to a co-worker and we both agree that Swingbench probably isn’t the right tool for what you looking for. Consider using AWR or STATSPACK report. Database Time Viewer is also a good real-time tool. We touched on it in this blog:

      https://houseofbrick.com/slob-and-db-time-monitor-part-2/

      Reply
  2. Hi Jim.
    Does this installation works on Windows Server environment?

    Reply
    • The installation does work on Windows because the tool was written in Java. Thanks for reading our blogs!

      Reply
  3. Where do i get to download swingbench 2.4? Currently we are on 12.1.0.2 and jva aversion is 7.

    Reply
    • If I understand your question correctly, you can run Swingbench independently of the database node, I would advocate in most cases it is better to run it from another workstation or laptop than where the database is running. With that in mind I recommend you download 2.6 Swingbench to a laptop/workstation with Java 8.

      You might be interested in our dbtimemonitor blog which covers another tool available on the Swingbench site – https://houseofbrick.com/slob-and-db-time-monitor-part-2/

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *