Skip to content

Instantly share code, notes, and snippets.

@muhamadazmy
Created November 14, 2023 12:25
Show Gist options
  • Save muhamadazmy/370182330a9d29fa6bd4e6b72a416025 to your computer and use it in GitHub Desktop.
Save muhamadazmy/370182330a9d29fa6bd4e6b72a416025 to your computer and use it in GitHub Desktop.
nbd device performance test

First test is using iozone against the mounted nbd device

The nbd device is a 4GB disk with 1GB cache only. the test writes/read/and rewrite a 1GB file, which means we live at the age of cache file. So rewrite, and random writes will definitely cause a cache evictions and loading from backend. The cache is also full (no free spce in cache) is entirely allocated by pages.

Note since i am running this on my laptop, where i don't have HDD the backend also live on an SSD device

the test command as shown in the output below is iozone -t1 -i0 -i2 -r1k -s1g /mnt/nbd

        Run began: Tue Nov 14 13:13:25 2023

        Record Size 1 kB
        File size set to 1048576 kB
        Command line used: iozone -t1 -i0 -i2 -r1k -s1g /mnt/nbd
        Output is in kBytes/sec
        Time Resolution = 0.000001 seconds.
        Processor cache size set to 1024 kBytes.
        Processor cache line size set to 32 bytes.
        File stride size set to 17 * record size.
        Throughput test with 1 process
        Each process writes a 1048576 kByte file in 1 kByte records

        Children see throughput for  1 initial writers  =  421528.94 kB/sec
        Parent sees throughput for  1 initial writers   =  237488.97 kB/sec
        Min throughput per process                      =  421528.94 kB/sec
        Max throughput per process                      =  421528.94 kB/sec
        Avg throughput per process                      =  421528.94 kB/sec
        Min xfer                                        = 1048576.00 kB

        Children see throughput for  1 rewriters        =  388271.31 kB/sec
        Parent sees throughput for  1 rewriters         =  229103.80 kB/sec
        Min throughput per process                      =  388271.31 kB/sec
        Max throughput per process                      =  388271.31 kB/sec
        Avg throughput per process                      =  388271.31 kB/sec
        Min xfer                                        = 1048576.00 kB

        Children see throughput for 1 random readers    =  673925.38 kB/sec
        Parent sees throughput for 1 random readers     =  653746.85 kB/sec
        Min throughput per process                      =  673925.38 kB/sec
        Max throughput per process                      =  673925.38 kB/sec
        Avg throughput per process                      =  673925.38 kB/sec
        Min xfer                                        = 1048576.00 kB

        Children see throughput for 1 random writers    =   13213.84 kB/sec
        Parent sees throughput for 1 random writers     =   13139.41 kB/sec
        Min throughput per process                      =   13213.84 kB/sec
        Max throughput per process                      =   13213.84 kB/sec
        Avg throughput per process                      =   13213.84 kB/sec
        Min xfer                                        = 1048576.00 kB


iozone test complete.

This test runs against my ssd directly as shown in the command line used

        Run began: Tue Nov 14 13:16:17 2023

        Record Size 1 kB
        File size set to 1048576 kB
        Command line used: iozone -t1 -i0 -i2 -r1k -s1g /opt
        Output is in kBytes/sec
        Time Resolution = 0.000001 seconds.
        Processor cache size set to 1024 kBytes.
        Processor cache line size set to 32 bytes.
        File stride size set to 17 * record size.
        Throughput test with 1 process
        Each process writes a 1048576 kByte file in 1 kByte records

        Children see throughput for  1 initial writers  =  403285.28 kB/sec
        Parent sees throughput for  1 initial writers   =  236887.53 kB/sec
        Min throughput per process                      =  403285.28 kB/sec
        Max throughput per process                      =  403285.28 kB/sec
        Avg throughput per process                      =  403285.28 kB/sec
        Min xfer                                        = 1048576.00 kB

        Children see throughput for  1 rewriters        =  497541.16 kB/sec
        Parent sees throughput for  1 rewriters         =  256352.72 kB/sec
        Min throughput per process                      =  497541.16 kB/sec
        Max throughput per process                      =  497541.16 kB/sec
        Avg throughput per process                      =  497541.16 kB/sec
        Min xfer                                        = 1048576.00 kB

        Children see throughput for 1 random readers    =  619068.94 kB/sec
        Parent sees throughput for 1 random readers     =  602831.53 kB/sec
        Min throughput per process                      =  619068.94 kB/sec
        Max throughput per process                      =  619068.94 kB/sec
        Avg throughput per process                      =  619068.94 kB/sec
        Min xfer                                        = 1048576.00 kB

        Children see throughput for 1 random writers    =   27818.76 kB/sec
        Parent sees throughput for 1 random writers     =   26177.42 kB/sec
        Min throughput per process                      =   27818.76 kB/sec
        Max throughput per process                      =   27818.76 kB/sec
        Avg throughput per process                      =   27818.76 kB/sec
        Min xfer                                        = 1048576.00 kB



iozone test complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment