; -- end job file -- Here we have no global section, as we only have one job defined anyway. We want to use async io here, with a depth of4foreach file. We also increased the buffer size used to32KB and define numjobs to4to fork 4 identical jobs. The result is4 processes each randomly writing to their own 64MB file. Instead ofusing the above job file, you could have given the parameters on the command line. For this case, you would specify: $ fio --name=random-writers --ioengine=libaio --iodepth=4 --rw=randwrite --bs=32k --direct=0 --size=64m --numjobs=4When fio is utilized as a basis ofany reasonably large test suite, it might be desirable toshare a setof standardized settings across multiple job files. Instead of copy/pasting such settings, anysection may pull in an external .fio file with'includefilename' directive, asin the following example: ;-- start job file including.fio -- [global] filename=/tmp/test filesize=1m include glob-include.fio [test] rw=randread bs=4k time_based=1 runtime=10 include test-include.fio ; -- end job file including.fio -- ; -- start job file glob-include.fio -- thread=1 group_reporting=1 ; -- end job file glob-include.fio -- ; -- start job file test-include.fio -- ioengine=libaio iodepth=4 ; -- end job file test-include.fio -- Settings pulled into a section apply to that section only (except global section). Include directives may be nested in that any included file may contain further include directive(s). Include files may not contain [] sections. 4.1 Environment variables ------------------------- fio also supports environment variable expansion in job files. Any sub-string of the form "${VARNAME}" as part of an option value (in other words, on the right of the `='),willbeexpandedtothevalueoftheenvironmentvariablecalledVARNAME.Ifnosuchenvironmentvariableisdefined,orVARNAMEistheemptystring,theemptystringwillbesubstituted.Asanexample,let's look at a sample fio invocation and job file: $ SIZE=64m NUMJOBS=4 fio jobfile.fio ; -- start job file -- [random-writers] rw=randwrite size=${SIZE} numjobs=${NUMJOBS} ; -- end job file -- This will expand to the following equivalent job file at runtime: ; -- start job file -- [random-writers] rw=randwrite size=64m numjobs=4 ; -- end job file -- fio ships with a few example job files, you can also look there for inspiration. 4.2 Reserved keywords --------------------- Additionally, fio has a setof reserved keywords that will be replaced internally with the appropriate value. Those keywords are: $pagesize The architecture page sizeof the running system $mb_memory Megabytes of total memory in the system $ncpus Numberof online available CPUs These can be used on the command line orin the job file, and will be automatically substituted with the current system valueswhen the job is run. Simple math is also supported on these keywords, so you can perform actions like: size=8*$mb_memory andget that properly expanded to8 times the sizeof memory in the machine. 5.0 Detailed list of parameters ------------------------------- This section describes in details each parameter associated with a job. Some parameters take an optionof a given type, such as an integeror a string. Anywhere a numericvalueis required, an arithmetic expression may be used, provided it is surrounded by parentheses. Supported operators are: addition (+) subtraction (-) multiplication (*) division (/) modulus (%) exponentiation (^)
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。