Skip to content

What IS the RWP*Load Simulator?

Bjørn Engsig edited this page Jan 10, 2024 · 1 revision

SQL*Plus is a great tool for executing ad hoc SQL and writing reports, PL/SQL is ideal for writing database centric application code, and the Bourne-Again SHell, bash, is very useful for scripting and programming. If you ever wanted the ability to program SQL*Plus, execute PL/SQL on the client side or use SQL directly in bash, you have come to the right place. This gap is exactly what the RWP*Load Simulator is filling in addition to its ability to actually simulate load.

The RWP*Load Simulator is a tool developed by the Real World Performance group at Oracle Corporation. While it on one side nicely fills the somewhat void space between the Oracle database, Linux scripting, and programming in e.g. C or Java, it also bridges a bit of the way into complex benchmarking tools.

If you ever had a need to do any of these:

  • Write scripts for Linux (bash, awk, sed) that integrates easily with the Oracle database
  • Simulate workloads while experimenting with database or application side parameters
  • Experiment with different connection methods or different sizes of session pools
  • Exercise limits of your environment; find where the "hockey stick" curve bends
  • Automatically create html reports with graphs showing scaling, performance, etc
  • Get statistics about application or database performance to embed in reports

and you found the standard sqlplus tool to be too limited and found that writing a full application in e.g. Java, C++ or Python to be too complex, you are likely to find rwloadsim to suit you well.

If you think of a bit of bash and SQL, a dose of PL/SQL, a nip of C or Java, a dash of awk, a grain of sed plus a few drops of secret sauce and put it all into one tool, you will have an idea about what rwloadsim is. In its core, it is a programming language that takes a bit of each of these known tools and programming languages and integrates them into one. As a very small example, this code will display rows from the EMP table that you probably have used before. If the following is in a file called emp.rwl (well, you need correct credentials and connect string):

# declare a database
database db username "scott" password "{password}" connect "//host/service" default;

# and some variables
integer empno, deptno:=10, numemps:=0;
$useroption:deptno # allow user to provide --deptno
string ename;

for
  select empno, ename -- select list element match variables
  from emp where deptno=:deptno -- bind matches variable
  /
loop # Execute a cursor loop
  printf "%4d %s\n", empno, ename; # use printf to output something
  numemps += 1; # count the number of rows
end loop;

if numemps=0 then # If there were no rows, print a message
  printline "No employees in department", deptno;
end if;

You can execute rwloadsim --deptno=20 emp.rwl and you will get a list of employees in department 20.

The RWP*Load Simulator comes complete with users guide (to be read directly at Github), reference documentation (available after install), simple demos to get you started and a complete oltp workload. The latter is vaguely similar to Swingbench.

It is important to understand that rwloadsim is not a general purpose application programming environment; it is a scripting and workload simulation tool. If you attempt using it beyond its design goals, you will quickly observe limitations. As just one example, it does not include a graphical interface, and the only reason you can get html pages with graphics out of it is that you can write code that generates html and code that calls gnuplot.

You should typically start with a binary distribution (found at Github releases), but you can also build it from sources or just look the sources to get under the hood. It is written in C with use of flex and bison. It is strongly recommended that you also have gnuplot and that you have a place to put html files such that you can view them from a browser.