1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 #
  22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23 # Use is subject to license terms.
  24 #
  25 # $dir - directory for datafiles
  26 # $eventrate - event generator rate (0 == free run)
  27 # $iosize - iosize for database block access
  28 # $nshadows - number of shadow processes
  29 # $ndbwriters - number of database writers
  30 # $nfiles - number of data files
  31 # $nlogfiles - number of log files
  32 
  33 set $dir=/tmp
  34 set $eventrate=0
  35 set $runtime=30
  36 set $iosize=2k
  37 set $nshadows=200
  38 set $ndbwriters=10
  39 set $usermode=200000
  40 set $filesize=10m
  41 set $memperthread=1m
  42 set $workingset=0
  43 set $cached=0
  44 set $logfilesize=10m
  45 set $nfiles=10
  46 set $nlogfiles=1
  47 set $directio=0
  48 
  49 eventgen rate = $eventrate
  50 
  51 # Define a datafile and logfile
  52 define fileset name=datafiles,path=$dir,size=$filesize,filesizegamma=0,entries=$nfiles,dirwidth=1024,prealloc=100,cached=$cached,reuse
  53 define fileset name=logfile,path=$dir,size=$logfilesize,filesizegamma=0,entries=$nlogfiles,dirwidth=1024,prealloc=100,cached=$cached,reuse
  54 
  55 define process name=lgwr,instances=1
  56 {
  57   thread name=lgwr,memsize=$memperthread,useism
  58   {
  59     flowop aiowrite name=lg-write,filesetname=logfile,
  60         iosize=256k,random,directio=$directio,dsync
  61     flowop aiowait name=lg-aiowait
  62     flowop semblock name=lg-block,value=3200,highwater=1000
  63   }
  64 }
  65 
  66 # Define database writer processes
  67 define process name=dbwr,instances=$ndbwriters
  68 {
  69   thread name=dbwr,memsize=$memperthread,useism
  70   {
  71     flowop aiowrite name=dbwrite-a,filesetname=datafiles,
  72         iosize=$iosize,workingset=$workingset,random,iters=100,opennext,directio=$directio,dsync
  73     flowop hog name=dbwr-hog,value=10000
  74     flowop semblock name=dbwr-block,value=1000,highwater=2000
  75     flowop aiowait name=dbwr-aiowait
  76   }
  77 }
  78 
  79 
  80 define process name=shadow,instances=$nshadows
  81 {
  82   thread name=shadow,memsize=$memperthread,useism
  83   {
  84     flowop read name=shadowread,filesetname=datafiles,
  85       iosize=$iosize,workingset=$workingset,random,opennext,directio=$directio
  86     flowop hog name=shadowhog,value=$usermode
  87     flowop sempost name=shadow-post-lg,value=1,target=lg-block,blocking
  88     flowop sempost name=shadow-post-dbwr,value=1,target=dbwr-block,blocking
  89     flowop eventlimit name=random-rate
  90   }
  91 }
  92 
  93 echo "OLTP Version 2.3 personality successfully loaded"
  94 usage "Usage: set \$dir=<dir>         defaults to $dir"
  95 usage " "
  96 usage "       set \$eventrate=<value> defaults to $eventrate"
  97 usage " "
  98 usage "       set \$filesize=<size>   defaults to $filesize, n.b. there are ten files of this size"
  99 usage " "
 100 usage "       set \$logfilesize=<size> defaults to $logfilesize, n.b. there is one file of this size"
 101 usage " "
 102 usage "       set \$iosize=<value>    defaults to $iosize, typically 2k or 8k"
 103 usage " "
 104 usage "       set \$cached=<bool>     defaults to $cached"
 105 usage " "
 106 usage "       set \$memperthread=<value> defaults to $memperthread"
 107 usage " "
 108 usage "       set \$directio=<value>  defaults to $directio"
 109 usage " "
 110 usage "       run runtime (e.g. run 60)"
 111 usage " "
 112 usage "Note - total filesize should be at least 2x physical memory size for conforming test)"
 113 usage "       i.e. if physmem = 4G, set filesize to 4G * 2 / 10, or 800m" 
 114 usage " "
 115 usage "Note - this workload needs at least 512MB of of memory"
 116 usage " "
 117