Guest User

Untitled

a guest
Oct 24th, 2026
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.19 KB | None | 0 0
  1.  
  2. # latency:     /dev/nbd1     10809
  3. # throughput: /dev/nbd2  10810
  4.  
  5. set -e
  6.  
  7. USER=$(whoami)
  8.  
  9. sudo echo got a password
  10.  
  11. fallocate -l 64g latency.img
  12. fallocate -l 64g throughput.img
  13.  
  14. # in case of old files... clear up
  15. wipefs -a ./latency.img
  16. wipefs -a ./throughput.img
  17.  
  18. rm -v latency.txt throughput.txt || echo cannot delete stats
  19. nbdkit          --filter=exitlast --filter=stats file latency.img statsfile=latency.txt
  20. nbdkit -p 10810 --filter=exitlast --filter=stats file throughput.img statsfile=throughput.txt
  21.  
  22. sudo nbd-client localhost /dev/nbd1
  23. sudo nbd-client localhost 10810 /dev/nbd2
  24.  
  25. sudo zpool create latency /dev/nbd1
  26. sudo zpool create throughput /dev/nbd2
  27.  
  28. sudo zfs set logbias=throughput throughput
  29.  
  30. sudo chown ${USER}:${USER} /latency
  31. sudo chown ${USER}:${USER} /throughput
  32.  
  33. OLD=$(pwd)
  34.  
  35. cd /throughput
  36. fio --rw=randrw --fsync=1 --sync_file_range=write --name=throughput --size=256m --output=${OLD}/throughput.fio
  37.  
  38. cd /latency
  39. fio --rw=randrw --fsync=1 --sync_file_range=write --name=latency    --size=256m --output=${OLD}/latency.fio
  40.  
  41. cd ${OLD}
  42.  
  43. sudo zpool export latency
  44. sudo zpool export throughput
  45.  
  46. sudo nbd-client -d /dev/nbd1
  47. sudo nbd-client -d /dev/nbd2
  48.  
  49.  
Advertisement
Add Comment
Please, Sign In to add comment