JamesKoopmann.com header image 2

Do you need a load generator for Oracle; Swingbench is free and simply great

February 20th, 2009 · 3 Comments

Swingbench screenshotsIf you’ve ever needed a load generator to test system loads you might
want to give Swingbench a try. I’ve used this tool on many occasions to
stress disk subsystems, performance tools, and general new features
within Oracle. Setup can be done within your own $HOME directory,
without pestering a system administrator or DBA.

Since I had a need (testing Oracle internals) I thought it would be a good idea to introduce and explain the installation process. Swingbench has different types of benchmarks you can run. For this post I’ve concentrated on the Calling Circle Benchmark (CC).

1. Download Swingbench here.

2. Download Java here.

3. FTP files to your system–placing them in the $HOME directory of the user

4. Uncompress the swingbench file
unzip swingbench230391.zip

5. Change to the swingbench directory
cd swingbench

6. Install the Jave Runtime Environment that was downloaded from java.sun.com. This was done by placing the self-extracting JRE file in the $HOME/swingbench directory—this allows for portability of a complete swingbench environment, just in case you’d like to move it between systems. Currently that directory is:$HOME/swingbench/jre1.6.0_12
mv ../jre-6u12-linux-i586.bin .
./jre-6u12-linux-i586.bin

7. Edit the swingbench.env file to reflect current Oracle environment. I changed the following two lines:
#!/bin/bash
# Set the following to reflect the root directory of your Java installation
export JAVAHOME=$HOME/swingbench/jre1.6.0_12
# Set the following to the directory where you installed swingbench
export SWINGHOME=/home/oracle/swingbench

8. Edit swingbench/bin/ccwizard.xml. A key parameter in this file is the “LightsOut” argument. This allows swingbench to be run in character mode–very helpful to schedule runs through crontab. This file also contains connect information to the Oracle database but is dependent on where and how Oracle  has been installed. Most arguments are self explanatory but care should be taken to set the argument values for datafiles of the data and index files to a directory that exists on the database server. I’d also recommend keeping the Mode=InterActive to validate configuration file changes or if you get errors during the process.

Mode of LightsOut will allow you to run from command line, keep as InterActive if you want to use the GUI
Increasing the number of accounts will increase the size of the datasets
Increasing the transaction count will increase the runtime of the benchmark

<?xml version=’1.0′ encoding=’windows-1252′?>
<WizardConfig Name=”Calling Circle Wizard” Mode=”LightsOut“>
  <WizardSteps RunnableStep=”5″>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step0″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step1″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step2″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step3″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step4″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step5″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step6″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step7″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step8″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step9″/>
    <WizardStep SourceFile=”com.dom.benchmarking.swingbench.wizards.cc.Step10″/>
  </WizardSteps>
  <DefaultParameters>
    <Parameter Key=”operation” Value=”create”/>
    <Parameter Key=”dbausername” Value=”sys as sysdba”/>
    <Parameter Key=”dbapassword” Value=”password”/>
    <Parameter Key=”username” Value=”CC”/>
    <Parameter Key=”password” Value=”CC”/>
    <Parameter Key=”connectionstring” Value=”//ludwig:1521/db11FS”/>
    <Parameter Key=”connectiontype” Value=”oci”/>
    <Parameter Key=”datatablespace” Value=”ccdata”/>
    <Parameter Key=”datadatafile” Value=”/oradata/db11FS/ccdata.dbf”/>
    <Parameter Key=”indextablespace” Value=”ccindex”/>
    <Parameter Key=”indexdatafile” Value=”/oradata/db11FS/ccindex.dbf”/>
    <Parameter Key=”directories” Value=”data/”/>
    <Parameter Key=”transactioncount” Value=”10000″/>
    <Parameter Key=”nocustaccounts” Value=”100000″/>

  </DefaultParameters>
</WizardConfig>

8. Create drop, create, and generate ccwizzrd xml files. For simplicity and possibly creating extra scripts to automate the process of running swingbench, the following three files should be created from the ccwizard.xml file edited above.

cd bin
cp ccwizard.xml ccwizard.xml-drop
cp ccwizard.xml ccwizard.xml-create
cp ccwizard.xml ccwizard.xml-generate

You then need to edit one line in each of these three files, such that:

ccwizard.xml-drop:
<Parameter Key=”operation” Value=”drop”/>

ccwizard.xml-create:
<Parameter Key=”operation” Value=”create”/>

ccwizard.xml-generate:
<Parameter Key=”operation” Value=”generate”/>

9. Create/Modify ccconfig.xml for running benchmarks. There is a sample ccconfig.xml in the swingbench/bin/sample directory. This file should be copied to the swingbench/bin directory and modified to suite the magnatude of benchmark being run. For instance you might want to change the NumberOfUsers.
cp sample/ccconfig.xml .

I changed the following lines in the ccconfig.xml file:
<UserName>CC</UserName>
      <Password>CC</Password>
      <ConnectString>//ludwig/db11FS</ConnectString>

11. You may want/need to make changes to your Oracle installation. The following commands are suggested areas to alter a default installation of Oracle. The actual directory path to specific files may be different depending on the mount point and Oracle SID.

alter database datafile ‘/oradata/db11FS/system01.dbf’ resize 1024m;
alter database tempfile ‘/oradata/db11FS/temp01.dbf’ resize 2048m;
alter database datafile ‘/oradata/db11FS/users01.dbf’ resize 500m;
alter database datafile ‘/oradata/db11FS/undotbs01.dbf’ resize 2048m;

alter database add logfile ‘/oradata/db11FS/redo04.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo05.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo06.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo07.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo08.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo09.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo10.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo11.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo12.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo13.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo14.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo15.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo16.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo17.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo18.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo19.log’ size 50m;
alter database add logfile ‘/oradata/db11FS/redo20.log’ size 50m;
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database add logfile ‘/oradata/db11FS/redo01.log’ size 50m reuse;
alter database add logfile ‘/oradata/db11FS/redo02.log’ size 50m reuse;
alter database add logfile ‘/oradata/db11FS/redo03.log’ size 50m reuse;

ALTER DATABASE DEFAULT TABLESPACE “USERS”;
ALTER SYSTEM SET open_cursors=5000 SCOPE=BOTH;
ALTER SYSTEM SET sessions=2000 SCOPE=SPFILE;
ALTER SYSTEM SET processes=5000 SCOPE=SPFILE;
ALTER SYSTEM SET sga_target=’1536M’ SCOPE=BOTH;

11. Validate sqlnet.ora file on database server. The sqlnet.ora file is in the $ORACLE_HOME/network/admin directory and should have the EZCONNECT entry as shown below. If there is no sqlnet.ora file that is acceptable also.

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

12. Create the tables for the benchmarks.
cp ccwizard.xml-create ccwizard.xml
./ccwizard

SwingBench Wizard
Author  :        Dominic Giles
Version :        2.3.0.391

Running in Lights Out Mode using config file : ccwizard.xml

13. Generate data for a benchmark run
cp ccwizard.xml-generate ccwizard.xml
./ccwizard
SwingBench Wizard
Author  :        Dominic Giles
Version :        2.3.0.391

Running in Lights Out Mode using config file : ccwizard.xml
http://www.jameskoopmann.com/images4blogs/minibench.JPG
14. Run a benchmark with minibench. This is a small GUI that gives displays the status of your benchmark run. minibench uses the configuration file swingconfig.xml. Since there are multiple types of benchmarks Swingbench is capable of we need to copy our benchmark to this file.
cp ccconfig.xml swingconfig.xml
./minibench

15. Optionally run the character based benchmark tool
./charbench -c ccconfig.xml
Author  :        Dominic Giles
Version :        2.3.0.391

Results will be written to results.xml.
Hit Return to Start & Terminate Run…

Time            Users   TPM     TPS
12:48:31 PM     20      143     6        




Tags: Review


3 responses so far ↓

  • 1 Alex Gordon // Apr 3, 2010 at 7:59 am

    Между нами говоря, попробуйте поискать ответ на Ваш вопрос в google.com…

    Специалист главный If you’ve ever needed a load generator to test system loads you might
    want to give Swingbench a try…..

  • 2 DmitryZ33-093 // May 18, 2010 at 8:10 am

    DmitryZ33-093…

    гляньте, какой сайт по современной технике http://habitation-rent.ru/, много полезного и интересного там найдете…

  • 3 Kylie Batt // May 18, 2010 at 9:11 pm

    Да, действительно. Я присоединяюсь ко всему выше сказанному. Можем пообщаться на эту тему….

    оператор связи stress disk subsystems, performance tools, and general new features
    within Oracle…..

You must log in to post a comment.