Skip to content

Commit bf361c8

Browse files
Arushi-07copybara-github
authored andcommitted
Use -si for diskspd prefill
PiperOrigin-RevId: 839570314
1 parent 320cada commit bf361c8

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

perfkitbenchmarker/configs/default_benchmark_config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,10 @@ diskspd_single_thread_latency:
516516
name: diskspd
517517
flags: &diskspd_single_thread_latency_flags
518518
num_striped_disks: 1
519-
data_disk_size: 500
520-
diskspd_file_size: 400G
519+
data_disk_size: 1024
520+
diskspd_file_size: 1000G
521+
provisioned_iops: 16000
522+
provisioned_throughput: 1000
521523
diskspd_thread_number_per_file: 1
522524
diskspd_outstanding_io: 1
523525
diskspd_block_size: 8k

perfkitbenchmarker/windows_packages/diskspd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,9 @@ def Prefill(running_vm):
487487

488488

489489
def RunDiskspdPrefillCommandForDuration(vm, diskspd_exe_dir, prefill_duration):
490+
# using -si so that all the threads share the same offset and don't overlap.
490491
diskspd_options = (
491-
f'-c{FLAGS.diskspd_file_size} -t16 -w100'
492+
f'-c{FLAGS.diskspd_file_size} -t16 -w100 -si'
492493
f' -b{DISKSPD_PREFILL_BLOCK_SIZE.value} -d{prefill_duration} -Rxml -Sh'
493494
f' -o16 -Zr C:\\scratch\\{DISKSPD_TMPFILE} > {DISKSPD_XMLFILE}'
494495
)

tests/windows_packages/diskspd_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import os
1818
import unittest
19+
from unittest import mock
1920
import xml.etree.ElementTree as ET
2021

2122
from absl import flags
@@ -184,6 +185,26 @@ def testGenerateDiskspdConfigBooleans(self):
184185
self.assertIn('-l', config)
185186
self.assertIn('-n', config)
186187

188+
@flagsaver.flagsaver(diskspd_file_size='1G', diskspd_prefill_block_size='1M')
189+
def testRunDiskspdPrefillCommandForDuration(self):
190+
vm = mock.Mock()
191+
with mock.patch.object(
192+
diskspd, '_CatXml', return_value='<xml>result</xml>'
193+
) as cat_xml_mock:
194+
with mock.patch.object(diskspd, '_RemoveXml') as remove_xml_mock:
195+
result = diskspd.RunDiskspdPrefillCommandForDuration(
196+
vm, '/tmp/x86', 100
197+
)
198+
self.assertEqual(result, '<xml>result</xml>')
199+
command = (
200+
'cd /tmp/x86; .\\diskspd.exe -c1G -t16 -w100 -si -b1M -d100 -Rxml'
201+
f' -Sh -o16 -Zr C:\\scratch\\{diskspd.DISKSPD_TMPFILE} >'
202+
f' {diskspd.DISKSPD_XMLFILE}'
203+
)
204+
vm.RobustRemoteCommand.assert_called_with(command)
205+
cat_xml_mock.assert_called_with(vm)
206+
remove_xml_mock.assert_called_with(vm)
207+
187208

188209
if __name__ == '__main__':
189210
unittest.main()

0 commit comments

Comments
 (0)