16701Saw148015# 26701Saw148015# CDDL HEADER START 36701Saw148015# 46701Saw148015# The contents of this file are subject to the terms of the 56701Saw148015# Common Development and Distribution License (the "License"). 66701Saw148015# You may not use this file except in compliance with the License. 76701Saw148015# 86701Saw148015# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 96701Saw148015# or http://www.opensolaris.org/os/licensing. 106701Saw148015# See the License for the specific language governing permissions 116701Saw148015# and limitations under the License. 126701Saw148015# 136701Saw148015# When distributing Covered Code, include this CDDL HEADER in each 146701Saw148015# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 156701Saw148015# If applicable, add the following below this CDDL HEADER, with the 166701Saw148015# fields enclosed by brackets "[]" replaced with your own identifying 176701Saw148015# information: Portions Copyright [yyyy] [name of copyright owner] 186701Saw148015# 196701Saw148015# CDDL HEADER END 206701Saw148015# 216701Saw148015# 22*9801SAndrew.W.Wilson@sun.com# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 236701Saw148015# Use is subject to license terms. 246701Saw148015# 256701Saw148015 266701Saw148015# RateLimCopyFiles.f uses the iopslimit flowop with the target attribute 276701Saw148015# set to the writewholefile flowop to limit the rate to one writewholefile 286701Saw148015# operation per event. Without the target attribute set, the limit will 296701Saw148015# be one writewholefile OR readwholefile operation per event, so in effect 306701Saw148015# it will run at half the rate. Without the target attribute, this workload 31*9801SAndrew.W.Wilson@sun.com# is identical to copyfiles.f. Set the event generator rate by setting 32*9801SAndrew.W.Wilson@sun.com# the $eventrate variable, for instance by typing: 33*9801SAndrew.W.Wilson@sun.com# set $eventrate=20 34*9801SAndrew.W.Wilson@sun.com# at the go_filebench prompt to get twenty events per second. 356701Saw148015# 36*9801SAndrew.W.Wilson@sun.com 37*9801SAndrew.W.Wilson@sun.com# $dir - directory for datafiles 38*9801SAndrew.W.Wilson@sun.com# $eventrate - event generator rate (0 == free run) 39*9801SAndrew.W.Wilson@sun.com# $filesize - size of data file 40*9801SAndrew.W.Wilson@sun.com# $iosize - size of each I/O request 41*9801SAndrew.W.Wilson@sun.com# $nfiles - number of files in the fileset 42*9801SAndrew.W.Wilson@sun.com# $nthreads - number of worker threads 43*9801SAndrew.W.Wilson@sun.com 446701Saw148015set $dir=/tmp 45*9801SAndrew.W.Wilson@sun.comset $eventrate=10 466701Saw148015set $dirwidth=20 476701Saw148015set $filesize=16k 486701Saw148015set $iosize=1m 496701Saw148015set $nfiles=1000 506701Saw148015set $nthreads=1 516701Saw148015 52*9801SAndrew.W.Wilson@sun.comeventgen rate=$eventrate 536701Saw148015set mode quit firstdone 546701Saw148015 556701Saw148015define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$dirwidth,prealloc=100 566701Saw148015define fileset name=destfiles,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$dirwidth 576701Saw148015 586701Saw148015define process name=filereader,instances=1 596701Saw148015{ 606701Saw148015 thread name=filereaderthread,memsize=10m,instances=$nthreads 616701Saw148015 { 626701Saw148015 flowop openfile name=openfile1,filesetname=bigfileset,fd=1 636701Saw148015 flowop readwholefile name=readfile1,fd=1,iosize=$iosize 646701Saw148015 flowop createfile name=createfile2,filesetname=destfiles,fd=2 656701Saw148015 flowop writewholefile name=writefile2,filesetname=destfiles,fd=2,srcfd=1,iosize=$iosize 666701Saw148015 flowop closefile name=closefile1,fd=1 676701Saw148015 flowop closefile name=closefile2,fd=2 686701Saw148015 flowop iopslimit name=iopslim1, target=writefile2 696701Saw148015 } 706701Saw148015} 716701Saw148015 72*9801SAndrew.W.Wilson@sun.comecho "RateLimCopyFiles Version 1.1 personality successfully loaded" 73*9801SAndrew.W.Wilson@sun.comusage "Usage: set \$dir=<dir> defaults to $dir" 74*9801SAndrew.W.Wilson@sun.comusage " set \$eventrate=<value> defaults to $eventrate" 756701Saw148015usage " set \$filesize=<size> defaults to $filesize" 766701Saw148015usage " set \$nfiles=<value> defaults to $nfiles" 776701Saw148015usage " set \$iosize=<size> defaults to $iosize" 786701Saw148015usage " set \$dirwidth=<value> defaults to $dirwidth" 796701Saw148015usage " set \$nthreads=<value> defaults to $nthreads" 806701Saw148015usage " " 816701Saw148015usage " run" 82