microsoft / diskspd

DISKSPD is a storage load generator / performance test tool from the Windows/Windows Server and Cloud Server Infrastructure Engineering teams
MIT License
1.16k stars 215 forks source link

Random Access Flag Not Reflected Correctly in XML Output #202

Closed 0x7FFFFFFFFFFFFFFF closed 1 year ago

0x7FFFFFFFFFFFFFFF commented 1 year ago

Description

When running DiskSpd with the -r option for random access, the generated XML output incorrectly shows <RandomAccess>false</RandomAccess>. This suggests that the random access flag is not being reported correctly in the XML output.

To Reproduce:

Here are the steps to reproduce the behavior:

Run DiskSpd with the -r option: diskspd.exe -c1024M -w10 -t14 -d30 -o2 -r -b4K -C1 -Z1G -W1 -Rxml -L -Sh "C:\diskspd.bin" > result.xml Open the generated XML output file result.xml. Notice that the RandomAccess field is set to false: <RandomAccess>false</RandomAccess>

Expected behavior:

Since I ran DiskSpd with the -r option for random access, I expected to see <RandomAccess>true</RandomAccess> in the XML output.

Environment:

<Tool>
    <Version>2.1.0-dev</Version>
    <VersionDate>2021/7/1</VersionDate>
</Tool>
dl2n commented 1 year ago

Random access in terms of DISKSPD's IO offset pattern is on the <Random> element, not <RandomAccess>.

The <RandomAccess> element refers to / controls whether the target file is opened with FILE_FLAG_RANDOM_ACCESS or not (see CreateFile). On the command line this comes from the -f[rst] option; the adjacent sequential/temporary flags are also spec'd here.

These flags only affected OS cached operation. RANDOM_ACCESS controls whether the kernel cache manager will attempt to do readahead into the cache based on an observed sequential/strided access pattern. Saying RANDOM_ACCESS turns that off. SEQUENTIAL is the opposite - it says it will be sequential, so it more aggressively does do readahead. Again, specific to cached operation.

If you use -Rpxml (print the XML profile; no run) it should be pretty easy/quick to verify the effect on the XML.

0x7FFFFFFFFFFFFFFF commented 1 year ago

Thanks for the clarification.