-
Notifications
You must be signed in to change notification settings - Fork 6
fio: Adding fio engine #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6043552
engines: Rename test_parse to test_parse_stressng
ErwanAliasr1 68afc75
benchmark: Link parameter with benchmark
ErwanAliasr1 924d7bc
bench/parameter: Adding get_name_with_position()
ErwanAliasr1 93551db
hwbench: Adding fio engine
ErwanAliasr1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # This configuration will : | ||
| # - test /dev/nvme0n1 in 4k randread for 40 seconds | ||
| # -- first with 4 stressors | ||
| # -- then with 6 stressors | ||
| [global] | ||
| runtime=40 | ||
| monitor=all | ||
|
|
||
| [randread_cmdline] | ||
| engine=fio | ||
| engine_module=cmdline | ||
| engine_module_parameter_base=--filename=/dev/nvme0n1 --direct=1 --rw=randread --bs=4k --ioengine=libaio --iodepth=256 --group_reporting --readonly | ||
| hosting_cpu_cores=all | ||
| hosting_cpu_cores_scaling=none | ||
| stressor_range=4,6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # FIO | ||
|
|
||
| hwbench can use [fio](https://github.com/axboe/fio) to perform storage benchmarking. | ||
| The current implementation requires fio >= 3.19. | ||
|
|
||
| # Concept | ||
| Fio is operated in three(3) different modes by selecting the `engine_module` directive. | ||
|
|
||
| ## Command line | ||
|
|
||
| When `engine_module=cmdline` is used, the content of `engine_module_parameter_base` will be passed directly to fio with some limitations. | ||
|
|
||
| The following fio keywords are automatically defined, or replaced if present, by hwbench : | ||
|
|
||
| - `--runtime`: set to match the exact duration of the current hwbench benchmark. | ||
| - `--time_based`: it's mandatory to have a benchmark lasting `runtime` seconds. | ||
| - `--output-format`: hwbench need the output to be set in `json+` for an easy integration. | ||
| - `--name`: hwbench will use the current job name to ensure its unique over the runs. | ||
| - `--numjobs`: defined by `stressor_range`, can be set as a unique value or a list of values. Each value will generate a new benchmark. | ||
| - `--write_{bw|lat|hist|iops}_logs`: hwbench will automatically collect the performance logs to let hwgraph doing time-based graphs. | ||
| - `--invalidate`: hwbench ensure that every benchmark will be done out of cache. | ||
|
|
||
| ### Sample configuration file | ||
|
|
||
| The following job defines two benchmarks on the same device (nvme0n1). | ||
|
|
||
| The `randread_cmdline` job will create : | ||
| - `randread_cmdline_0` benchmark with ``numjobs=4`` extracted from `stressor_range` list | ||
| - `randread_cmdline_1` benchmark with ``numjobs=6`` extracted from `stressor_range` list | ||
|
|
||
| ``` | ||
| [randread_cmdline] | ||
| runtime=600 | ||
| engine=fio | ||
| engine_module=cmdline | ||
| engine_module_parameter_base=--filename=/dev/nvme0n1 --direct=1 --rw=randread --bs=4k --ioengine=libaio --iodepth=256 --group_reporting --readonly | ||
| hosting_cpu_cores=all | ||
| hosting_cpu_cores_scaling=none | ||
| stressor_range=4,6 | ||
| ``` | ||
|
|
||
| Please note the `hosting_cpu_cores` only selects a set of cores to pin fio. A possible usage would be using a list of cores with a `hosting_cpu_cores_scaling` to study the performance of the same storage device from different NUMA domains. | ||
|
|
||
| ## External file execution | ||
| Hwbench execute an already existing fio job file. | ||
|
|
||
| Not yet implemented. | ||
|
|
||
| ## Automatic job definition | ||
| Hwbench automatically creates jobs based on some hardware detection and profiles. | ||
|
|
||
| Not yet implemented. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| from . import test_benchmarks_common as tbc | ||
|
|
||
|
|
||
| class TestFio(tbc.TestCommon): | ||
| def __init__(self, *args, **kwargs): | ||
| super().__init__(*args, **kwargs) | ||
| self.load_mocked_hardware( | ||
| cpucores="./hwbench/tests/parsing/cpu_cores/v2321", | ||
| cpuinfo="./hwbench/tests/parsing/cpu_info/v2321", | ||
| numa="./hwbench/tests/parsing/numa/8domainsllc", | ||
| ) | ||
| self.load_benches("./hwbench/config/fio.conf") | ||
| self.parse_jobs_config() | ||
| self.QUADRANT0 = list(range(0, 16)) + list(range(64, 80)) | ||
| self.QUADRANT1 = list(range(16, 32)) + list(range(80, 96)) | ||
| self.ALL = list(range(0, 128)) | ||
|
|
||
| def test_fio(self): | ||
| """Check fio syntax.""" | ||
| assert self.benches.count_benchmarks() == 2 | ||
| assert self.benches.count_jobs() == 1 | ||
| assert self.benches.runtime() == 80 | ||
|
|
||
| for bench in self.benches.benchs: | ||
| assert bench.validate_parameters() is None | ||
| assert bench.get_parameters().get_name() == "randread_cmdline" | ||
|
|
||
| bench_0 = self.get_bench_parameters(0) | ||
| assert ( | ||
| bench_0.get_engine_module_parameter_base() | ||
| == "--filename=/dev/nvme0n1 --direct=1 --rw=randread --bs=4k --ioengine=libaio --iodepth=256 --group_reporting --readonly --runtime=40 --time_based --output-format=json+ --numjobs=4 --name=randread_cmdline_0 --invalidate=1 --log_avg_msec=20000 --write_bw_log=fio/randread_cmdline_0_bw.log --write_lat_log=fio/randread_cmdline_0_lat.log --write_hist_log=fio/randread_cmdline_0_hist.log --write_iops_log=fio/randread_cmdline_0_iops.log" | ||
| ) | ||
|
|
||
| bench_1 = self.get_bench_parameters(1) | ||
| assert ( | ||
| bench_1.get_engine_module_parameter_base() | ||
| == "--filename=/dev/nvme0n1 --direct=1 --rw=randread --bs=4k --ioengine=libaio --iodepth=256 --group_reporting --readonly --runtime=40 --time_based --output-format=json+ --numjobs=6 --name=randread_cmdline_1 --invalidate=1 --log_avg_msec=20000 --write_bw_log=fio/randread_cmdline_1_bw.log --write_lat_log=fio/randread_cmdline_1_lat.log --write_hist_log=fio/randread_cmdline_1_hist.log --write_iops_log=fio/randread_cmdline_1_iops.log" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # This configuration will : | ||
| # - test /dev/nvme0n1 in 4k randread for 40 seconds | ||
| # -- first with 4 stressors | ||
| # -- then with 6 stressors | ||
| # | ||
| # As runtime is set to 30s by the user, it should be replaced by runtime=40 defined by hardware bench | ||
| [global] | ||
| runtime=40 | ||
| monitor=all | ||
|
|
||
| [randread_cmdline] | ||
| engine=fio | ||
| engine_module=cmdline | ||
| engine_module_parameter_base=--filename=/dev/nvme0n1 --direct=1 --rw=randread --bs=4k --name TOBEREMOVED --ioengine=libaio --iodepth=256 --group_reporting --readonly --runtime=30 --time_based --time_based --numjobs=10 --name=plop --name _REMOVE_ME | ||
| hosting_cpu_cores=all | ||
| hosting_cpu_cores_scaling=none | ||
| stressor_range=4,6 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| from unittest.mock import patch | ||
|
|
||
| import pytest | ||
|
|
||
| from hwbench.bench import test_benchmarks_common as tbc | ||
| from hwbench.environment.mock import MockHardware | ||
|
|
||
|
|
||
| class TestParseConfig(tbc.TestCommon): | ||
| def __init__(self, *args, **kwargs): | ||
| super().__init__(*args, **kwargs) | ||
| self.hw = MockHardware() | ||
| self.load_benches("./hwbench/config/fio.conf") | ||
|
|
||
| def test_sections_name(self): | ||
| """Check if sections names are properly detected.""" | ||
| sections = self.get_jobs_config().get_sections() | ||
| assert sections == [ | ||
| "randread_cmdline", | ||
| ] | ||
|
|
||
| def test_keywords(self): | ||
| """Check if all keywords are valid.""" | ||
| try: | ||
| with patch("hwbench.utils.helpers.is_binary_available") as iba: | ||
| iba.return_value = True | ||
| self.get_jobs_config().validate_sections() | ||
| except Exception as exc: | ||
| pytest.fail(f"'validate_sections' detected a syntax error {exc}") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.