FIO¶
fio (Flexible I/O Tester) — the standard Linux I/O benchmarking and stress-testing tool. Wraps job file generation, execution, and result parsing.
sts.fio.fio
¶
FIO test execution.
FIO
pydantic-model
¶
Bases: StsBaseModel
FIO test execution.
Example
fio = FIO() # Uses default parameters
fio = FIO('/dev/sda') # Uses device with default parameters
fio = FIO(parameters=DefaultParameters(name='test')) # Custom parameters
Show JSON schema:
{
"$defs": {
"FIOParameters": {
"additionalProperties": false,
"description": "Base FIO parameters.",
"properties": {
"name": {
"default": "sts-fio",
"title": "Name",
"type": "string"
},
"ioengine": {
"default": "libaio",
"enum": [
"libaio",
"sync",
"posixaio",
"mmap",
"splice"
],
"title": "Ioengine",
"type": "string"
},
"direct": {
"default": true,
"title": "Direct",
"type": "boolean"
},
"rw": {
"default": "randrw",
"enum": [
"read",
"write",
"randread",
"randwrite",
"randrw",
"trim"
],
"title": "Rw",
"type": "string"
},
"bs": {
"default": "4k",
"minLength": 1,
"title": "Bs",
"type": "string"
},
"numjobs": {
"default": 1,
"title": "Numjobs",
"type": "integer"
},
"group_reporting": {
"default": false,
"title": "Group Reporting",
"type": "boolean"
},
"verify_fatal": {
"default": false,
"title": "Verify Fatal",
"type": "boolean"
},
"end_fsync": {
"default": false,
"title": "End Fsync",
"type": "boolean"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filename"
},
"size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"runtime": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Runtime"
},
"iodepth": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Iodepth"
},
"verify": {
"anyOf": [
{
"enum": [
"crc32",
"crc32c",
"crc32c-intel",
"md5",
"sha1",
"sha256",
"sha512",
"xxhash",
"meta"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify"
},
"verify_backlog": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify Backlog"
}
},
"title": "FIOParameters",
"type": "object"
}
},
"additionalProperties": false,
"description": "FIO test execution.\n\nExample:\n ```python\n fio = FIO() # Uses default parameters\n fio = FIO('/dev/sda') # Uses device with default parameters\n fio = FIO(parameters=DefaultParameters(name='test')) # Custom parameters\n ```",
"properties": {
"filename": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filename"
},
"parameters": {
"anyOf": [
{
"$ref": "#/$defs/FIOParameters"
},
{
"type": "null"
}
],
"default": null
},
"options": {
"items": {
"type": "string"
},
"title": "Options",
"type": "array"
},
"config_file": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Config File"
}
},
"title": "FIO",
"type": "object"
}
Fields:
-
filename(PathOrStr | None) -
parameters(FIOParameters | None) -
options(list[str]) -
config_file(PathOrStr | None)
Validators:
-
_init_parameters
Source code in sts_libs/src/sts/fio/fio.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
load_block_params()
¶
Load block device parameters.
Source code in sts_libs/src/sts/fio/fio.py
126 127 128 | |
load_config_file(config_file)
¶
Load parameters from FIO config file.
Raises:
| Type | Description |
|---|---|
FIOConfigError
|
If config file is invalid or cannot be read |
Source code in sts_libs/src/sts/fio/fio.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
load_default_params()
¶
Load default parameters.
Source code in sts_libs/src/sts/fio/fio.py
118 119 120 | |
load_fs_params()
¶
Load filesystem parameters.
Source code in sts_libs/src/sts/fio/fio.py
122 123 124 | |
load_stress_params()
¶
Load stress test parameters.
Source code in sts_libs/src/sts/fio/fio.py
130 131 132 | |
run()
¶
Run FIO test.
Raises:
| Type | Description |
|---|---|
FIOExecutionError
|
If the fio package cannot be installed or the command cannot be built. |
Source code in sts_libs/src/sts/fio/fio.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
save_config_file(config_file)
¶
Save parameters to FIO config file.
Raises:
| Type | Description |
|---|---|
FIOConfigError
|
If parameters are not set or file cannot be written |
Source code in sts_libs/src/sts/fio/fio.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
update_options(options)
¶
Add options, deduplicating against existing ones.
Source code in sts_libs/src/sts/fio/fio.py
114 115 116 | |
update_parameters(params)
¶
Update parameters.
Source code in sts_libs/src/sts/fio/fio.py
107 108 109 110 111 112 | |
sts.fio.parameters
¶
FIO parameter configurations.
BlockDeviceParameters
pydantic-model
¶
Bases: FIOParameters
Parameters optimized for block device IOPS testing: random reads with high concurrency.
Show JSON schema:
{
"additionalProperties": false,
"description": "Parameters optimized for block device IOPS testing: random reads with high concurrency.",
"properties": {
"name": {
"default": "sts-fio",
"title": "Name",
"type": "string"
},
"ioengine": {
"default": "libaio",
"enum": [
"libaio",
"sync",
"posixaio",
"mmap",
"splice"
],
"title": "Ioengine",
"type": "string"
},
"direct": {
"default": true,
"title": "Direct",
"type": "boolean"
},
"rw": {
"default": "randread",
"enum": [
"read",
"write",
"randread",
"randwrite",
"randrw",
"trim"
],
"title": "Rw",
"type": "string"
},
"bs": {
"default": "512",
"title": "Bs",
"type": "string"
},
"numjobs": {
"default": 4,
"title": "Numjobs",
"type": "integer"
},
"group_reporting": {
"default": true,
"title": "Group Reporting",
"type": "boolean"
},
"verify_fatal": {
"default": false,
"title": "Verify Fatal",
"type": "boolean"
},
"end_fsync": {
"default": false,
"title": "End Fsync",
"type": "boolean"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filename"
},
"size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"runtime": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": 1800,
"title": "Runtime"
},
"iodepth": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 32,
"title": "Iodepth"
},
"verify": {
"anyOf": [
{
"enum": [
"crc32",
"crc32c",
"crc32c-intel",
"md5",
"sha1",
"sha256",
"sha512",
"xxhash",
"meta"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify"
},
"verify_backlog": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify Backlog"
}
},
"title": "BlockDeviceParameters",
"type": "object"
}
Fields:
-
name(str) -
ioengine(IOEngine) -
direct(bool) -
verify_fatal(bool) -
end_fsync(bool) -
filename(str | None) -
size(str | None) -
verify(VerifyType | None) -
verify_backlog(int | None) -
rw(RWType) -
bs(str) -
numjobs(int) -
group_reporting(bool) -
iodepth(int | None) -
runtime(int | None)
Source code in sts_libs/src/sts/fio/parameters.py
106 107 108 109 110 111 112 113 114 | |
DefaultParameters
pydantic-model
¶
Bases: FIOParameters
Default parameters for general FIO testing: random read/write with verification.
Show JSON schema:
{
"additionalProperties": false,
"description": "Default parameters for general FIO testing: random read/write with verification.",
"properties": {
"name": {
"default": "sts-fio",
"title": "Name",
"type": "string"
},
"ioengine": {
"default": "libaio",
"enum": [
"libaio",
"sync",
"posixaio",
"mmap",
"splice"
],
"title": "Ioengine",
"type": "string"
},
"direct": {
"default": true,
"title": "Direct",
"type": "boolean"
},
"rw": {
"default": "randrw",
"enum": [
"read",
"write",
"randread",
"randwrite",
"randrw",
"trim"
],
"title": "Rw",
"type": "string"
},
"bs": {
"default": "4k",
"minLength": 1,
"title": "Bs",
"type": "string"
},
"numjobs": {
"default": 1,
"title": "Numjobs",
"type": "integer"
},
"group_reporting": {
"default": true,
"title": "Group Reporting",
"type": "boolean"
},
"verify_fatal": {
"default": true,
"title": "Verify Fatal",
"type": "boolean"
},
"end_fsync": {
"default": false,
"title": "End Fsync",
"type": "boolean"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filename"
},
"size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"runtime": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": 60,
"title": "Runtime"
},
"iodepth": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 32,
"title": "Iodepth"
},
"verify": {
"anyOf": [
{
"enum": [
"crc32",
"crc32c",
"crc32c-intel",
"md5",
"sha1",
"sha256",
"sha512",
"xxhash",
"meta"
],
"type": "string"
},
{
"type": "null"
}
],
"default": "crc32",
"title": "Verify"
},
"verify_backlog": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 1024,
"title": "Verify Backlog"
}
},
"title": "DefaultParameters",
"type": "object"
}
Fields:
-
name(str) -
ioengine(IOEngine) -
direct(bool) -
rw(RWType) -
bs(str) -
numjobs(int) -
end_fsync(bool) -
filename(str | None) -
size(str | None) -
group_reporting(bool) -
verify_fatal(bool) -
iodepth(int | None) -
runtime(int | None) -
verify(VerifyType | None) -
verify_backlog(int | None)
Source code in sts_libs/src/sts/fio/parameters.py
85 86 87 88 89 90 91 92 93 | |
FIOParameters
pydantic-model
¶
Bases: StsBaseModel
Base FIO parameters.
Show JSON schema:
{
"additionalProperties": false,
"description": "Base FIO parameters.",
"properties": {
"name": {
"default": "sts-fio",
"title": "Name",
"type": "string"
},
"ioengine": {
"default": "libaio",
"enum": [
"libaio",
"sync",
"posixaio",
"mmap",
"splice"
],
"title": "Ioengine",
"type": "string"
},
"direct": {
"default": true,
"title": "Direct",
"type": "boolean"
},
"rw": {
"default": "randrw",
"enum": [
"read",
"write",
"randread",
"randwrite",
"randrw",
"trim"
],
"title": "Rw",
"type": "string"
},
"bs": {
"default": "4k",
"minLength": 1,
"title": "Bs",
"type": "string"
},
"numjobs": {
"default": 1,
"title": "Numjobs",
"type": "integer"
},
"group_reporting": {
"default": false,
"title": "Group Reporting",
"type": "boolean"
},
"verify_fatal": {
"default": false,
"title": "Verify Fatal",
"type": "boolean"
},
"end_fsync": {
"default": false,
"title": "End Fsync",
"type": "boolean"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filename"
},
"size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"runtime": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Runtime"
},
"iodepth": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Iodepth"
},
"verify": {
"anyOf": [
{
"enum": [
"crc32",
"crc32c",
"crc32c-intel",
"md5",
"sha1",
"sha256",
"sha512",
"xxhash",
"meta"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify"
},
"verify_backlog": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify Backlog"
}
},
"title": "FIOParameters",
"type": "object"
}
Config:
validate_assignment:True
Fields:
-
name(str) -
ioengine(IOEngine) -
direct(bool) -
rw(RWType) -
bs(str) -
numjobs(int) -
group_reporting(bool) -
verify_fatal(bool) -
end_fsync(bool) -
filename(str | None) -
size(str | None) -
runtime(int | None) -
iodepth(int | None) -
verify(VerifyType | None) -
verify_backlog(int | None)
Source code in sts_libs/src/sts/fio/parameters.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
from_file(path)
classmethod
¶
Create parameters from FIO config file, or None on parse failure.
Source code in sts_libs/src/sts/fio/parameters.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
to_dict()
¶
Convert parameters to FIO command format (bools become '1', None fields omitted).
Source code in sts_libs/src/sts/fio/parameters.py
51 52 53 54 55 56 57 58 59 60 61 62 | |
FileSystemParameters
pydantic-model
¶
Bases: FIOParameters
Parameters optimized for filesystem testing: sequential writes with large block size.
Show JSON schema:
{
"additionalProperties": false,
"description": "Parameters optimized for filesystem testing: sequential writes with large block size.",
"properties": {
"name": {
"default": "sts-fio",
"title": "Name",
"type": "string"
},
"ioengine": {
"default": "sync",
"enum": [
"libaio",
"sync",
"posixaio",
"mmap",
"splice"
],
"title": "Ioengine",
"type": "string"
},
"direct": {
"default": true,
"title": "Direct",
"type": "boolean"
},
"rw": {
"default": "write",
"enum": [
"read",
"write",
"randread",
"randwrite",
"randrw",
"trim"
],
"title": "Rw",
"type": "string"
},
"bs": {
"default": "1M",
"title": "Bs",
"type": "string"
},
"numjobs": {
"default": 1,
"title": "Numjobs",
"type": "integer"
},
"group_reporting": {
"default": false,
"title": "Group Reporting",
"type": "boolean"
},
"verify_fatal": {
"default": false,
"title": "Verify Fatal",
"type": "boolean"
},
"end_fsync": {
"default": true,
"title": "End Fsync",
"type": "boolean"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filename"
},
"size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "10G",
"title": "Size"
},
"runtime": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Runtime"
},
"iodepth": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Iodepth"
},
"verify": {
"anyOf": [
{
"enum": [
"crc32",
"crc32c",
"crc32c-intel",
"md5",
"sha1",
"sha256",
"sha512",
"xxhash",
"meta"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify"
},
"verify_backlog": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify Backlog"
}
},
"title": "FileSystemParameters",
"type": "object"
}
Fields:
-
name(str) -
direct(bool) -
numjobs(int) -
group_reporting(bool) -
verify_fatal(bool) -
filename(str | None) -
runtime(int | None) -
iodepth(int | None) -
verify(VerifyType | None) -
verify_backlog(int | None) -
ioengine(IOEngine) -
rw(RWType) -
bs(str) -
end_fsync(bool) -
size(str | None)
Source code in sts_libs/src/sts/fio/parameters.py
96 97 98 99 100 101 102 103 | |
StressParameters
pydantic-model
¶
Bases: FIOParameters
Parameters for stress/endurance testing: high concurrency random read/write.
Show JSON schema:
{
"additionalProperties": false,
"description": "Parameters for stress/endurance testing: high concurrency random read/write.",
"properties": {
"name": {
"default": "sts-fio",
"title": "Name",
"type": "string"
},
"ioengine": {
"default": "libaio",
"enum": [
"libaio",
"sync",
"posixaio",
"mmap",
"splice"
],
"title": "Ioengine",
"type": "string"
},
"direct": {
"default": true,
"title": "Direct",
"type": "boolean"
},
"rw": {
"default": "randrw",
"enum": [
"read",
"write",
"randread",
"randwrite",
"randrw",
"trim"
],
"title": "Rw",
"type": "string"
},
"bs": {
"default": "4k",
"minLength": 1,
"title": "Bs",
"type": "string"
},
"numjobs": {
"default": 64,
"title": "Numjobs",
"type": "integer"
},
"group_reporting": {
"default": true,
"title": "Group Reporting",
"type": "boolean"
},
"verify_fatal": {
"default": false,
"title": "Verify Fatal",
"type": "boolean"
},
"end_fsync": {
"default": false,
"title": "End Fsync",
"type": "boolean"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filename"
},
"size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"runtime": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": 3600,
"title": "Runtime"
},
"iodepth": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 64,
"title": "Iodepth"
},
"verify": {
"anyOf": [
{
"enum": [
"crc32",
"crc32c",
"crc32c-intel",
"md5",
"sha1",
"sha256",
"sha512",
"xxhash",
"meta"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify"
},
"verify_backlog": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Verify Backlog"
}
},
"title": "StressParameters",
"type": "object"
}
Fields:
-
name(str) -
ioengine(IOEngine) -
direct(bool) -
rw(RWType) -
bs(str) -
verify_fatal(bool) -
end_fsync(bool) -
filename(str | None) -
size(str | None) -
verify(VerifyType | None) -
verify_backlog(int | None) -
numjobs(int) -
group_reporting(bool) -
iodepth(int | None) -
runtime(int | None)
Source code in sts_libs/src/sts/fio/parameters.py
117 118 119 120 121 122 123 | |