Pages

Friday, January 10, 2020

SwingBench - Load generator for Oracle (free)

В данной заметке приведен пример использования бесплатного инструмента по нагрузке БД Oracle под названием SwingBench.





==============================================
1. About SwingBench:
==============================================

Swingbench is a load generation benchmark utility created by an Oracle employee, Dominic Giles. The tool is not an official Oracle product. As such, you cannot obtain support for it. But Swingbench is a nifty benchmark utility that many database administrators may find very useful. Swingbench can be found for download by pointing a web browser to http://dominicgiles.com/swingbench.html and clicking on the download link. The download is a simple zip file and can be unzipped with normal OS utilities. Swingbench is a Java program so it can be run on most any platform that supports Java. All of the Swingbench utilities can be invoked with command line options that facilitate scripting for multiple benchmark runs.

==============================================
2. Benchmarks description:
==============================================

SwingBench includes 6 benchmarks:

-> OrderEntry is based on the "oe" schema that ships with Oracle 12c/Oracle 18c/Oracle 19c. It has been modified so that Spatial, Intermedia schema's do not need to be installed. It can be run continuously (that is until you run out of space). It introduces heavy contention on a small number of tables and is designed to stress interconnects and memory. It is installed using the "oewizard" located in the bin directory. Both a pure jdbc and pl/sql (lower network overhead) variant exist of the benchmark.

-> SalesHistory is based on the "sh" schema that ships with Oracle 12c/Oracle 18c/Oracle 19c and is designed to test the performance of complicated queries when run against large tables. It is read only and can be scaled over a number of default sizes from 1GB to 1TB. A custom mode also allows for the creation of smaller and larger schemas

-> CallingCircle (deprecated) simulates the SQL that is generated for an online telco application. It requires data files to be generated and copied from the database server to the load generator before each run, it typically requires between 1 and 8 GB of disk space. Both benchmarks are heavily CPU intensive. Experience has shown that you require at least 1 processor of load generator to every 2 processors of database server. It is designed to stress the CPU and memory without the need for a powerful I/O subsystem. Its is installed using the "ccwizard" located in the bin directory

-> StressTest simply fires random inserts,updates,selects and updates against a well know table.

-> JSON Stresstest is based on simple JSON documents modelling people flying between airports. It follow a basic CRUD model

-> TPC-DS Like Benchmark is a benchmark similar to TPC-DS. It features both a query and transaction workload in separate configuration files.

==============================================
3. Setup "StressTest" benchmark example:
==============================================

Note: SwingBench setup below performed on Windows 10 platform. Database (12.1.0.2) is running on Oracle Linux 6.9.

-> Download and Unzip SwingBench tarball

uzip swingbenchlatest.zip

-> Create required database objects

Start "oewizard 2.bat"

#############
ISSUE:
#############

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

#############
FIX:
#############

http://www.dominicgiles.com/blog/files/9a92f74f753a4ce32f5bb4912b5c6523-114.html

Corrected "launcher.xml" file. Set memory settings as below:
++++++++++
...
...
...
    <jvmargset id="base.jvm.args">
      <jvmarg line="-Xmx1024m"/>
      <jvmarg line="-Xms512m"/>
<!--<jvmarg line="-Djava.util.logging.config.file=log.properties"/>-->
   </jvmargset>

<jvmargset id="datagenerator.jvm.args">
      <jvmarg line="-Xmx1024m"/>
      <jvmarg line="-Xms512m"/>
</jvmargset>
++++++++++

Another possible cause of this issue is Java 32-Bit on my Desktop: http://oracledbalogs.blogspot.com/2016/01/swingbench-oewizard-heap-size-error.html?m=0











Click "Finish" button.




==============================================
4. Start load:
==============================================

-> Start "swingbench.bat"




Click "Start Benchmark Run"



Here is the picture after few mins of the workload:




==============================================
5. Environment:
==============================================

Client: Windows 10 Desktop

Database server: Virtual Machine (VMware® Workstation - 11.1.0 build-2496824) with 16 GB RAM, 4 CPU (8 Threads).

==============================================
* Sources:
==============================================

http://www.dominicgiles.com/swingbench.html
http://houseofbrick.com/swingbench-installation-and-setup/
http://www.dba-oracle.com/t_swingbench.htm
http://longwhiteclouds.com/2015/07/07/performance-testing-oracle-databases-with-swingbench-order-entry-schema/
https://www.youtube.com/watch?v=bovbie3kGGw