https://github.com/johnramsden/zncache
ZNS drive workload testing
https://github.com/johnramsden/zncache
Last synced: 2 months ago
JSON representation
ZNS drive workload testing
- Host: GitHub
- URL: https://github.com/johnramsden/zncache
- Owner: johnramsden
- License: mit
- Created: 2025-01-14T06:19:41.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-03-28T05:38:58.000Z (2 months ago)
- Last Synced: 2025-03-28T06:27:22.008Z (2 months ago)
- Language: C
- Size: 454 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZNWorkload
Test workloads for ZNS
## Setup
Clone repo:
```shell
git clone https://github.com/johnramsden/ZNWorkload.git --recursive
```Compile dependencies:
```shell
./build-deps.sh
```Compile project:
```shell
meson setup buildDir
meson compile -C buildDir
```There are various variables that can be set: (defaults in `meson_options.txt`)
* `debugging`: Enables debug output (default true)
* `debugsymbols`: Enables debug symbols
* `verify`: Enables correctness verification (default true)
* `BLOCK_ZONE_CAPACITY`: Sets SSD zone size (default 1077MiB 1129316352)
* `READ_SLEEP_US`: Read delay to simulate remote data (default 40430us)
* `PROFILING_INTERVAL_SEC`: Interval to print metrics on (averaged) (default 10)
* `PROFILER_PRINT_EVERY`: Print metrics on every call, not just at interval (default true)
* `EVICT_HIGH_THRESH_ZONES`: High water mark for zone eviction
* `EVICT_LOW_THRESH_ZONES`: Low water mark for zone eviction
* `EVICT_HIGH_THRESH_CHUNKS`: High water mark for chunk eviction
* `EVICT_LOW_THRESH_CHUNKS`: Low water mark for chunk eviction
* `EVICT_INTERVAL_US`: Sleep time between evictions (us) (default 100,000, or 0.1s)
* `EVICTION_POLICY`: (`ZN_EVICT_PROMOTE_ZONE`, `ZN_EVICT_CHUNK`) Eviction policy, default `ZN_EVICT_PROMOTE_ZONE`
* `MAX_ZONES_USED`: Set maximum zones to use (default 0 means all)To modify these:
```shell
meson setup --reconfigure buildDir -Dverify=true -Ddebugging=true -DBLOCK_ZONE_CAPACITY=1048576
meson compile -C buildDir
```## Testing and Development
Create an emulated ZNS device via `scripts/nullblk-zones.sh` with:
* sector size: 4096B
* zone size: 32MiB
* conventional zones (non seq writes): 0
* sequential zones: 100```shell
./scripts/nullblk.sh 4096 32 0 100 "zns" # or ssd
``````
Created /dev/nullb0
```To destroy:
```shell
./scripts/nullblk-zoned-delete.sh 0 # Replace 0 with ID if different
```# Workloads
For detailed experiment reproduction, see [WORKLOADS](docs/WORKLOADS.md)
### Min-workload
For mini-test:
* 14 zones
* 8chunks per zone
* `2*14=28 is capacity`
* Start evict at 2 zones free: `24` entries
* On evict, evict 4 zones: `20` entries remainZNS:
```shell
./scripts/nullblk.sh 4096 1 0 14 "zns"
```On SSD:
```shell
./scripts/nullblk.sh 4096 1 0 14 "ssd"
``````shell
./zncache /dev/nullb0 524288 2
```This means 2chunks to fill a zone: `1024*1024/2`
### Documentation
Run `doxygen`:
```shell
doxygen Doxyfile
```Open `docs/html/index.html` in a browser.
### Formatting
Run `clang-format`:
```shell
clang-format -i src/ze_cache.c
```