1 6701 aw148015 # 2 6701 aw148015 # CDDL HEADER START 3 6701 aw148015 # 4 6701 aw148015 # The contents of this file are subject to the terms of the 5 6701 aw148015 # Common Development and Distribution License (the "License"). 6 6701 aw148015 # You may not use this file except in compliance with the License. 7 6701 aw148015 # 8 6701 aw148015 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 6701 aw148015 # or http://www.opensolaris.org/os/licensing. 10 6701 aw148015 # See the License for the specific language governing permissions 11 6701 aw148015 # and limitations under the License. 12 6701 aw148015 # 13 6701 aw148015 # When distributing Covered Code, include this CDDL HEADER in each 14 6701 aw148015 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 6701 aw148015 # If applicable, add the following below this CDDL HEADER, with the 16 6701 aw148015 # fields enclosed by brackets "[]" replaced with your own identifying 17 6701 aw148015 # information: Portions Copyright [yyyy] [name of copyright owner] 18 6701 aw148015 # 19 6701 aw148015 # CDDL HEADER END 20 6701 aw148015 # 21 6701 aw148015 # 22 9801 Andrew # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 6701 aw148015 # Use is subject to license terms. 24 6701 aw148015 # 25 6701 aw148015 26 6701 aw148015 # RateLimCopyFiles.f uses the iopslimit flowop with the target attribute 27 6701 aw148015 # set to the writewholefile flowop to limit the rate to one writewholefile 28 6701 aw148015 # operation per event. Without the target attribute set, the limit will 29 6701 aw148015 # be one writewholefile OR readwholefile operation per event, so in effect 30 6701 aw148015 # it will run at half the rate. Without the target attribute, this workload 31 9801 Andrew # is identical to copyfiles.f. Set the event generator rate by setting 32 9801 Andrew # the $eventrate variable, for instance by typing: 33 9801 Andrew # set $eventrate=20 34 9801 Andrew # at the go_filebench prompt to get twenty events per second. 35 6701 aw148015 # 36 9801 Andrew 37 9801 Andrew # $dir - directory for datafiles 38 9801 Andrew # $eventrate - event generator rate (0 == free run) 39 9801 Andrew # $filesize - size of data file 40 9801 Andrew # $iosize - size of each I/O request 41 9801 Andrew # $nfiles - number of files in the fileset 42 9801 Andrew # $nthreads - number of worker threads 43 9801 Andrew 44 6701 aw148015 set $dir=/tmp 45 9801 Andrew set $eventrate=10 46 6701 aw148015 set $dirwidth=20 47 6701 aw148015 set $filesize=16k 48 6701 aw148015 set $iosize=1m 49 6701 aw148015 set $nfiles=1000 50 6701 aw148015 set $nthreads=1 51 6701 aw148015 52 9801 Andrew eventgen rate=$eventrate 53 6701 aw148015 set mode quit firstdone 54 6701 aw148015 55 6701 aw148015 define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$dirwidth,prealloc=100 56 6701 aw148015 define fileset name=destfiles,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$dirwidth 57 6701 aw148015 58 6701 aw148015 define process name=filereader,instances=1 59 6701 aw148015 { 60 6701 aw148015 thread name=filereaderthread,memsize=10m,instances=$nthreads 61 6701 aw148015 { 62 6701 aw148015 flowop openfile name=openfile1,filesetname=bigfileset,fd=1 63 6701 aw148015 flowop readwholefile name=readfile1,fd=1,iosize=$iosize 64 6701 aw148015 flowop createfile name=createfile2,filesetname=destfiles,fd=2 65 6701 aw148015 flowop writewholefile name=writefile2,filesetname=destfiles,fd=2,srcfd=1,iosize=$iosize 66 6701 aw148015 flowop closefile name=closefile1,fd=1 67 6701 aw148015 flowop closefile name=closefile2,fd=2 68 6701 aw148015 flowop iopslimit name=iopslim1, target=writefile2 69 6701 aw148015 } 70 6701 aw148015 } 71 6701 aw148015 72 9801 Andrew echo "RateLimCopyFiles Version 1.1 personality successfully loaded" 73 9801 Andrew usage "Usage: set \$dir=<dir> defaults to $dir" 74 9801 Andrew usage " set \$eventrate=<value> defaults to $eventrate" 75 6701 aw148015 usage " set \$filesize=<size> defaults to $filesize" 76 6701 aw148015 usage " set \$nfiles=<value> defaults to $nfiles" 77 6701 aw148015 usage " set \$iosize=<size> defaults to $iosize" 78 6701 aw148015 usage " set \$dirwidth=<value> defaults to $dirwidth" 79 6701 aw148015 usage " set \$nthreads=<value> defaults to $nthreads" 80 6701 aw148015 usage " " 81 6701 aw148015 usage " run" 82