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# This workloads emulates a video server. It has two filesets, one of videos 26# being actively served, and one of videos availabe but currently inactive 27# (passive). However, one thread, vidwriter, is writing new videos to replace 28# no longer viewed videos in the passive set. Meanwhile $nthreads threads are 29# serving up videos from the activevids fileset. If the desired rate is R mb/s, 30# and $nthreads is set to T, then set the $srvbwrate to R * T to get the 31# desired rate per video stream. The video replacement rate of one video 32# file per replacement interval, is set by $repintval which defaults to 33# 10 seconds. Thus the write bandwidth will be set as $filesize/$repintval. 34 35set $dir=/tmp 36set $eventrate=96 37set $filesize=10g 38set $nthreads=48 39set $numactivevids=32 40set $numpassivevids=194 41set $reuseit=false 42set $readiosize=256k 43set $writeiosize=1m 44# 45set $passvidsname=passivevids 46set $actvidsname=activevids 47# 48set $repintval=10 49 50eventgen rate=$eventrate 51 52define fileset name=$actvidsname,path=$dir,size=$filesize,entries=$numactivevids,dirwidth=4,prealloc,paralloc,reuse=$reuseit 53define fileset name=$passvidsname,path=$dir,size=$filesize,entries=$numpassivevids,dirwidth=20,prealloc=50,paralloc,reuse=$reuseit 54 55define process name=vidwriter,instances=1 56{ 57 thread name=vidwriter,memsize=10m,instances=1 58 { 59 flowop deletefile name=vidremover,filesetname=$passvidsname 60 flowop createfile name=wrtopen,filesetname=$passvidsname,fd=1 61 flowop writewholefile name=newvid,iosize=$writeiosize,fd=1,srcfd=1 62 flowop closefile name=wrtclose, fd=1 63 flowop delay name=replaceinterval, value=$repintval 64 } 65} 66 67define process name=vidreaders,instances=1 68{ 69 thread name=vidreaders,memsize=10m,instances=$nthreads 70 { 71 flowop read name=vidreader,filesetname=$actvidsname,iosize=$readiosize 72 flowop bwlimit name=serverlimit, target=vidreader 73 } 74} 75 76echo "Video Server Version 1.1 personality successfully loaded" 77usage "Usage: set \$dir=<dir> defaults to $dir" 78usage " set \$eventrate=<value> defaults to $eventrate" 79usage " set \$filesize=<size> defaults to $filesize" 80usage " set \$nthreads=<value> defaults to $nthreads" 81usage " set \$writeiosize=<value> defaults to $writeiosize" 82usage " set \$readiosize=<value> defaults to $readiosize" 83usage " set \$numactivevids=<value> defaults to $numactivevids" 84usage " set \$numpassivevids=<value> defaults to $numpassivevids" 85usage " " 86usage " run runtime (e.g. run 60)" 87 88