Today majority of enterprises are moving or at least considering moving some load into the Cloud.
What you need to be aware in such case, system requirements for a Cloud load are quite different when comparing with on-premises, mainly due to many new moving parts that are not present within classical environment such as sharing model, latency, storage/CPU/memory/network virtualization etc.
To estimate required resources, you need to have standard set of tests you can rely on.
Such tests have to be repeatable, complex, and flexible enough to be able to compare results no matter what configuration you have in place such as pluggable database, RAC or single instance, and no matter whether you are running your load on-premises, private-cloud, hybrid-cloud or public cloud.
Swingbench is one of the tools that can get the job done.
You can run it against single instance or RAC database, it can generate reports and is flexible enough through xml configuration files where not only that you can change almost all configuration options, but you can also write your own SQL queries to perform stress tests.
And the best part – thanks to Dominic Giles, the tool is absolutely free.
In the previous blog I’ve described how to install Oracle database in the AWS.
On the following link you can find (almost) the whole process:
Here I want to concentrate more on how to perform actual testing by using Swingbench.
It is important to note that I have limited resources on disposal (t2.micro – 1 vCPU, 1Gb RAM, 1 Gb swap, 40 Gb HDD).
At the moment of writing, I suggest to download the latest version 2.6.1076 from the following link:
and to upload it on your EC2 machine:
user@ip-address:~/> scp -r -i "/path/to/private/key/key.pem" /source/directory/swingbench261076.zip email@example.com:/home/ec2-user
To complete the installation, you need to unzip swingbench261076.zip in your HOME directory (e.g. oracle).
Swingbench is written in Java.
Minimal version of JDK you need to have on your system is Java 8.
If you try to install JDK 11, you need to be aware that due to the project Jigsaw, there is no longer support for Java EE modules in JDK 11 like JAXBContext.
For that reason, if you try to start Swingbench oewizard, the following errors will be thrown.
firstname.lastname@example.org:~/swingbench/bin>./oewizard java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.commons.launcher.ChildMain.run(ChildMain.java:228) Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext at com.dom.benchmarking.swingbench.jaxb.WizardFactory.getConfiguration(WizardFactory.java:20) at com.dom.benchmarking.swingbench.wizards.WizardConfiguration.<init>(WizardConfiguration.java:35) at com.dom.benchmarking.swingbench.wizards.Wizard.<init>(Wizard.java:48) at com.dom.benchmarking.swingbench.wizards.Wizard.main(Wizard.java:536) ... 5 more Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ...
The easiest way to resolve that issue is to install JDK 8 instead of JDK 11.
#remove JDK 11 email@example.com:/home/oracle>yum remove jdk #install JDK 8 instead firstname.lastname@example.org:/home/ec2-user>rpm -ivh jdk-8u221-linux-x64.rpm
It is also advisable to create a separate tablespace to perform tests
SYS@orcl> create tablespace soe datafile '/u01/oradata/orcl/soe01.dbf' size 100m autoextend on next 100m maxsize unlimited extent management local autoallocate;
and to extend temp tablespace:
SYS@orcl> alter tablespace temp add tempfile '/u01/oradata/orcl/temp02.dbf' size 100m autoextend on NEXT 100m MAXSIZE unlimited;
Now you can run oewizzard again (you need to setup X11 and DISPLAY env variable) by executing the following command:
Normally you would need to populate at least 100 Gb (preferably 1 Tb) of data for any serious measurement, but in this case I’ve generated only 1Gb for this demo.
After you finish with generating data, you also need to check & modify SOE_Client_Side.xml file (especially password entry and check if connection string is valid), and finally you are ready to start with testing.
For Cloud testing, I’m usually running Swingbench in character mode which I’ve found is the most appropriate.
Here is the command to put some load during 1 minute interval:
oracle@ip-address:~/> ./charbench -c ../configs/SOE_Client_Side.xml -cs //internal_ip_address/orcl.ec2.internal -dt thin -uc 20 -r result_test01.xml -rt 00:01
Down below you can find several slides from the measurement.
There is no point to go through the results in detail (you can only spot a lot of issues) since this is only the showcase with very limited resources (1 CPU, IOPS limits, 1 Gb of memory etc.).
Finally you can download test results in pdf.
Main purpose of this article is to describe how to perform complex and repeatable stress & performance tests that will allow you to compare and tune your database no matter if it is running on-premises or on Cloud.
Although the collected results due to the limited resources are useless, you can use the same procedure as a baseline to perform very complex tests against Exadata/Exacloud/Autonomous Database/RAC/multitenant (pluggable) or single instance Oracle database.