SLOB (Silly Little Oracle Benchmark) is a benchmarking tool that drives lots of real database I/O using minimal CPU resources. It is therefore THE best tool to run I/O related database tests.
Outrun has SLOB prepackaged as RPM files so it is easy to set it up and run it.
- Via the menu
- Go to System - Install, select "slob" and install it
- Via the CLI
yum install slob
The slob RPM is the user configuration component but triggers install of slob-core which has the core SLOB files from the official tarball.
Update: Outrun now provides a single SLOB RPM package replacing the older slob-core and slob.rpm packages. It is also available via the Outrun Extras repository.
SLOB is based on Linux shell scripts, a few binaries (the wait_kit) and some SQL scripts. Therefore there are no other dependencies. However, it is not menu or GUI driven and you need to do some command-line work to run it.
The user component sets up a "slob" user with DBA rights on the system and copies the password from the root user.
SSH to the system and log in as "slob" (either ssh slob@hostname or login as root and do a
su - slob.
Editing the configuration
With the slob setup, 1 directory gets installed in the slob users' home directory:
The etc directory contains the slob.conf file that you may edit for your environment. My recommendation is to start with a very small setup to see if SLOB works correctly, then dropping all users and build a larger dataset for real testing.
UPDATE_PCT=25 RUN_TIME=300 WORK_LOOP=0 SCALE=80M WORK_UNIT=64 REDO_STRESS=LITE LOAD_PARALLEL_DEGREE=4 SHARED_DATA_MODULUS=0
This means if you don't change anything, SLOB will run each test for 5 minutes (300 seconds) and performs a select/update ratio of 75/25. SCALE=80M means for each user, SLOB creates 80 MiB of table data (roughly 10,000 rows). The setup phase will attempt to load 4 users concurrently. Beware that the higher this value the faster the data generation process - but too high values may cause running out of temp space, memory (PGA) etc and the load may fail.
Setting up SLOB with 4 users of 80MiB each is a good starting point.
SLOB requires a connection to the Oracle database with SYSDBA privileges. If you run it on Outrun, the newly created "slob" user will be a member of the "dba" and "asmdba" groups, and the login will set the ORACLE_HOME and ORACLE_SID automatically (to the first listed database in /etc/oratab). If that's what you want then you don't need to setup database users or connection.
If you want to connect to another database (can be on another, even non-Linux system) you need to setup the connect string in slob.conf. Modify the following section to achieve this:
# Settings for SQL*Net connectivity: #ADMIN_SQLNET_SERVICE=slob #SQLNET_SERVICE_BASE=slob #SQLNET_SERVICE_MAX=2 #SYSDBA_PASSWD=change_on_install
NOTE that SLOB creates users with names USER0..USERXX. If you run against an existing database, make sure these users don't already exist for other purposes as this may cause serious problems.
Creating a tablespace
SLOB requires a pre-configured tablespace to store its data. Usually the tablespace is named IOPS but you can choose any name.
- As slob user, start a SQL*Plus session to connect to the database as SYSDBA:
sqlplus / as sysdba or use the shortcut
You should get a message that you are connected to the database (here, the database is named DEMO):
Connected to: Oracle Database 11g Enterprise Edition Release 126.96.36.199.0 - 64bit Production With the Partitioning and Automatic Storage Management options SYS:DEMO > _
At the SYS> prompt, run the script that Outrun provides to create a tablespace:
Enter the following values:
Enter name of new tablespace: IOPS Enter size of tablespace: 1G Enter diskgroup to use: DATA Enter maximum size of tablespace: 1G Enter auto increment size (default 100M): <ENTER>
Non-Outrun (standalone) users need to setup the tablespace using their own methods.
SQL*Plus now shows the command and the result:
old 1: CREATE BIGFILE TABLESPACE &NAME DATAFILE '+&DG(DATAFILE)' SIZE &SIZE AUTOEXTEND ON NEXT &INCR MAXSIZE &MAXSIZE NOLOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO new 1: CREATE BIGFILE TABLESPACE IOPS DATAFILE '+DATA(DATAFILE)' SIZE 1G AUTOEXTEND ON NEXT 100M MAXSIZE 1G NOLOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO Tablespace created.
Running the setup
- Go back to the Linux prompt (logged in as slob)
- Start the setup phase using tablespace IOPS with 4 users:
slob-setup IOPS 4
"slob-setup" is a wrapper script for SLOB's "setup.sh" which makes SLOB use the config file in $HOME/etc, creates separate logging folders and allows additional command-line options. For example, if SCALE is set to 80M in the config file but you want to create users with 100M, instead of modifying slob.conf you can simply run:
slob-setup IOPS 4 SCALE=100M
You may also specify another slob.conf (-c option) or a different logging folder (-l).
You should get a series of logging messages, of which the last one shows something like this:
NOTIFY : 2015.09.16-09:56:07 : SLOB setup complete. Total setup time: (42 seconds)
Modifying AWR reporting
By default, Oracle will create AWR reports every 60 minutes. If AWR takes a snapshot in the middle of a SLOB run, you will get incorrect AWR reports as they will only report over part of the SLOB run period. To avoid this, you need to set the AWR interval to a very long time. See Pythian - My First Experience Running SLOB – Don’t Repeat My Errors (AWR)
The RPM provides a SQL script to make life easier:
SYS:DEMO > @set-awrinterval Current settings: Interval Retention (min) (min) -------- --------- 60 4320 Enter baseline window size (default 1): Enter AWR snapshot interval (default 60): 51120000 Enter AWR retention (default 4320): 51120000
Running the SLOB test
- At the linux prompt, enter the command to run with 4 users:
slob-run will create a log directory ($HOME/log) under which you will find the results of the benchmark run. As you can specify this directory on the command line, you can automate multiple SLOB runs each with their own logging folder:
for u in 0 10 20 30 ; do slob-run -l log-$u 2 UPDATE_PCT=$u ; done