xref: /onnv-gate/usr/src/cmd/filebench/workloads/randomfileaccess.f (revision 9801:4a9784073e11)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24# Exercises the indexed attribute of the fileset_pick() function.
25#
26
27set $dir=/tmp
28set $cached=false
29set $meandirwidth=20
30set $nthreads=5
31set $nfiles=10000
32set $sync=false
33
34define randvar name=$wrtiosize, min=512, round=512, type=gamma, mean=16k
35
36define randvar name=$rdiosize, type=tabular, min=8k, round=1k, randtable =
37{{85,   8k,  8k},
38 {15,   8k, 64k}
39}
40
41define randvar name=$filesize, type=tabular, min=1k, randtable =
42{{33,   1k,    1k},
43 {21,   1k,    3k},
44 {13,   3k,    5k},
45 {10,   5k,   11k},
46 {08,  11k,   21k},
47 {05,  21k,   43k},
48 {04,  43k,   85k},
49 {03,  85k,  171k},
50 {02, 171k,  341k},
51 {01, 341k, 1707k}
52}
53
54define randvar name=$fileidx, type=gamma, min=0, gamma=100
55
56define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,cached=$cached
57
58define process name=netclient,instances=1
59{
60  thread name=fileuser,memsize=10m,instances=$nthreads
61  {
62    flowop openfile name=openfile1,filesetname=bigfileset,indexed=$fileidx,fd=1
63    flowop openfile name=openfile2,filesetname=bigfileset,indexed=$fileidx,fd=2
64    flowop openfile name=openfile3,filesetname=bigfileset,indexed=$fileidx,fd=3
65    flowop appendfilerand name=appendfilerand1,iosize=$wrtiosize,fd=1
66    flowop closefile name=closefile1,fd=1
67    flowop readwholefile name=readfile1,iosize=$rdiosize,fd=2
68    flowop readwholefile name=readfile2,iosize=$rdiosize,fd=3
69    flowop closefile name=closefile2,fd=2
70    flowop closefile name=closefile3,fd=3
71  }
72}
73
74echo  "NetworkServer Version 1.1 personality successfully loaded"
75usage "Usage: set \$dir=<dir>            defaults to $dir"
76usage "       set \$cached=<bool>        defaults to $cached"
77usage "       set \$wrtiosize.type=<type>   defaults to $wrtiosize.type"
78usage "       set \$wrtiosize.randsrc=<src> defaults to $wrtiosize.randsrc"
79usage "       set \$wrtiosize.mean=<mean>   defaults to $wrtiosize.mean"
80usage "       set \$wrtiosize.gamma=<gamma> defaults to $wrtiosize.gamma"
81usage "       set \$rdiosize.type=<type>   defaults to $rdiosize.type"
82usage "       set \$rdiosize.randsrc=<src> defaults to $rdiosize.randsrc"
83usage "       set \$filesize.type=<type>   defaults to $filesize.type"
84usage "       set \$filesize.randsrc=<src> defaults to $filesize.randsrc"
85usage "       set \$nfiles=<value>       defaults to $nfiles"
86usage "       set \$nthreads=<value>     defaults to $nthreads"
87usage "       set \$sync=<bool>          defaults to $sync"
88usage " "
89usage "       run runtime (e.g. run 60)"
90