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 33set $dir=/tmp 34set $eventrate=0 35set $runtime=30 36set $iosize=2k 37set $nshadows=200 38set $ndbwriters=10 39set $usermode=200000 40set $filesize=10m 41set $memperthread=1m 42set $workingset=0 43set $cached=0 44set $logfilesize=10m 45set $nfiles=10 46set $nlogfiles=1 47set $directio=0 48 49eventgen rate = $eventrate 50 51# Define a datafile and logfile 52define fileset name=datafiles,path=$dir,size=$filesize,filesizegamma=0,entries=$nfiles,dirwidth=1024,prealloc=100,cached=$cached,reuse 53define fileset name=logfile,path=$dir,size=$logfilesize,filesizegamma=0,entries=$nlogfiles,dirwidth=1024,prealloc=100,cached=$cached,reuse 54 55define 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 67define 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 80define 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 93echo "OLTP Version 2.3 personality successfully loaded" 94usage "Usage: set \$dir=<dir> defaults to $dir" 95usage " " 96usage " set \$eventrate=<value> defaults to $eventrate" 97usage " " 98usage " set \$filesize=<size> defaults to $filesize, n.b. there are ten files of this size" 99usage " " 100usage " set \$logfilesize=<size> defaults to $logfilesize, n.b. there is one file of this size" 101usage " " 102usage " set \$iosize=<value> defaults to $iosize, typically 2k or 8k" 103usage " " 104usage " set \$cached=<bool> defaults to $cached" 105usage " " 106usage " set \$memperthread=<value> defaults to $memperthread" 107usage " " 108usage " set \$directio=<value> defaults to $directio" 109usage " " 110usage " run runtime (e.g. run 60)" 111usage " " 112usage "Note - total filesize should be at least 2x physical memory size for conforming test)" 113usage " i.e. if physmem = 4G, set filesize to 4G * 2 / 10, or 800m" 114usage " " 115usage "Note - this workload needs at least 512MB of of memory" 116usage " " 117 118