하이퍼디스크 성능 벤치마킹


하이퍼디스크 성능을 벤치마킹하려면 dd와 같은 다른 디스크 벤치마킹 도구 대신 가변형 I/O 테스터(FIO)를 사용하세요. 기본적으로 dd는 매우 얕은 I/O 큐 깊이를 사용하므로 벤치마크에서 디스크 성능을 정확하게 테스트하기에 충분한 수의 바이트 및 I/O 작업을 생성하기 어렵습니다.

또한 dd와 함께 사용되는 특수 기기는 매우 느려 디스크 성능을 정확하게 반영하지 못합니다. 일반적으로 하이퍼디스크 성능 벤치마크에서는 /dev/urandom, /dev/random, /dev/zero와 같은 특수 기기 사용을 방지하세요.

실행 중인 인스턴스에서 사용되는 디스크의 IOPS와 처리량을 측정하려면 원하는 구성으로 파일 시스템을 벤치마킹합니다. 이 옵션을 사용하면 기존 디스크의 콘텐츠가 손실되는 일 없이 실제 워크로드를 테스트할 수 있습니다. 기존 디스크의 파일 시스템을 벤치마킹할 때 개발 환경에 특정한 많은 요소가 벤치마킹 결과에 영향을 미칠 수 있으며 디스크 성능 한도에 도달하지 않을 수 있습니다.

하이퍼디스크의 원시 성능을 측정하려면 블록 기기를 직접 벤치마킹합니다. 이 옵션을 사용하면 원시 디스크 성능을 디스크 성능 한도와 비교할 수 있습니다.

다음 명령어는 apt 패키지 관리자를 사용하는 Debian 또는 Ubuntu 운영체제에서 작동합니다.

실행 중인 인스턴스에서 디스크의 IOPS 및 처리량 벤치마킹

디스크의 콘텐츠가 손실되지 않으면서 실행 중인 VM 인스턴스의 활성 디스크에 있는 실제 워크로드의 IOPS와 처리량을 측정하려면 기존 파일 시스템의 새 디렉터리를 기준으로 벤치마킹합니다.

테스트 준비

  1. 인스턴스에 연결

  2. 종속 항목을 설치합니다.

    sudo apt update
    sudo apt install -y fio
    
  3. 하이퍼디스크가 아직 포맷되지 않았으면 디스크를 포맷하고 마운트합니다.

  4. 터미널에서 VM에 연결된 디스크를 나열하고 테스트할 디스크를 찾습니다.

    sudo lsblk
    

    위 명령어는 다음과 비슷한 출력을 생성합니다.

    NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
    nvme0n1      259:0    0    10G  0 disk
    ├─nvme0n1p1  259:1    0   9.9G  0 part  /
    ├─nvme0n1p14 259:2    0     4M  0 part
    └─nvme0n1p15 259:3    0   106M  0 part  /boot/efi
    nvme0n2      259:4    0   3.4T  0 disk
    

    이 예시에서는 기기 이름 nvme0n2를 사용하여 3,500GiB 하이퍼디스크 익스트림 볼륨을 테스트합니다.

  5. 디스크에 새 디렉터리 fiotest를 만듭니다. 이 예시에서는 디스크가 /mnt/disks/mnt_dir에 마운트됩니다.

    TEST_DIR=/mnt/disks/mnt_dir/fiotest
    sudo mkdir -p $TEST_DIR
    
  6. 하이퍼디스크 연결을 위해 VM에 NVMe 디스크 인터페이스가 사용되는 경우(원시 디스크 이름에 nvme 프리픽스가 사용된 경우) 다음 단계를 수행하여 VM에 사용 가능한 NUMA 노드 수를 가져옵니다.

    NUMA 노드가 하나만 있는 VM과 NUMA 노드가 한 개 넘게 있는 VM은 NVMe 디스크의 벤치마킹 전략이 서로 다릅니다. NVMe 디스크 인터페이스를 사용하여 하이퍼디스크 성능을 테스트할 때는 큐당 256의 NVMe 큐 크기만 할당됩니다. 사용 가능한 NVMe 큐 크기가 제한적이고 동일한 VM에 연결된 다른 디스크와 콘텐츠 경합 가능성이 있기 때문에 이러한 벤치마크 테스트에서는 256 I/O 깊이를 처리할 수 있는 집계된 큐 크기를 유지하기 위해 2개의 NVMe 디스크 큐를 사용합니다.

    1. NUMA 노드 수를 가져옵니다.

      lscpu | grep -i 'numa node(s)' | awk '{print $NF}'
      
    2. VM에 NUMA 노드가 1개만 있으면 CPU-NVMe 큐 매핑을 가져옵니다. 이 정보는 나중에 --cpus-allowed 매개변수에 사용됩니다.

      QUEUE_1_CPUS=$(cat /sys/class/block/nvme0n2/mq/*/cpu_list | sed -n 1p | tr -d " \t")
      QUEUE_2_CPUS=$(cat /sys/class/block/nvme0n2/mq/*/cpu_list | sed -n 2p | tr -d " \t")
      

쓰기 처리량 테스트

I/O 블록 크기를 1MB로 설정하고 I/O 깊이를 64 이상으로 설정한 상태로 여러 동시 스트림(16개 이상)에 순차적 쓰기를 수행하여 쓰기 처리량을 테스트합니다.

  1. 하이퍼디스크에서 SCSI 인터페이스를 사용하는 경우:

    sudo fio --directory=$TEST_DIR \
    --numjobs=16 --size=10G --time_based \
    --runtime=5m --ramp_time=10s --ioengine=libaio \
    --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=write \
    --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
    --name=write_throughput
    
  2. 하이퍼디스크에서 NVMe 인터페이스를 사용하는 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 \
      --size=10G --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=write \
      --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
      --cpus_allowed_policy=split \
      --group_reporting \
      --name=write_throughput --cpus_allowed=$QUEUE_1_CPUS \
      --name=write_throughput_2 --cpus_allowed=$QUEUE_2_CPUS
      
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 \
      --size=10G --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=write \
      --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
      --group_reporting \
      --name=write_throughput --numa_cpu_nodes=0 \
      --name=write_throughput_2 --numa_cpu_nodes=1
      

쓰기 IOPS 테스트

I/O 블록 크기를 4KB로 설정하고 I/O 깊이를 256 이상으로 설정한 상태로 무작위 쓰기를 수행하여 쓰기 IOPS를 테스트합니다.

  1. 하이퍼디스크가 SCSI 인터페이스를 사용하여 연결된 경우:

    sudo fio --directory=$TEST_DIR \
    --numjobs=16 --size=10G -time_based \
    --runtime=5m --ramp_time=10s --ioengine=libaio \
    --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randwrite \
    --iodepth_batch_submit=256  --iodepth_batch_complete_max=256 \
    --name=write_iops
    
  2. 하이퍼디스크에서 NVMe 인터페이스를 사용하는 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 \
      --size=10G --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randwrite \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --cpus_allowed_policy=split \
      --group_reporting \
      --name=write_iops --cpus_allowed=$QUEUE_1_CPUS \
      --name=write_iops_2 --cpus_allowed=$QUEUE_2_CPUS
      
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 --size=10G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randwrite \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --group_reporting \
      --name=write_iops --numa_cpu_nodes=0 \
      --name=write_iops_2 --numa_cpu_nodes=1
      

읽기 처리량 테스트

I/O 블록 크기를 1MB로 설정하고 I/O 깊이를 최소 64 이상으로 설정한 상태로 여러 동시 스트림(16개 이상)에 순차적 읽기를 수행하여 읽기 처리량을 테스트합니다.

  1. 하이퍼디스크에서 SCSI 인터페이스를 사용하는 경우:

    sudo fio --directory=$TEST_DIR \
    --numjobs=16 --size=10G --time_based \
    --runtime=5m --ramp_time=10s --ioengine=libaio \
    --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=read \
    --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
    --name=read_throughput
    
  2. 하이퍼디스크에서 NVMe 인터페이스를 사용하는 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 --size=10G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=read \
      --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
      --cpus_allowed_policy=split \
      --group_reporting \
      --name=read_throughput --cpus_allowed=$QUEUE_1_CPUS \
      --name=read_throughput_2 --cpus_allowed=$QUEUE_2_CPUS
      
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 --size=10G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=read \
      --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
      --group_reporting \
      --name=read_throughput --numa_cpu_nodes=0 \
      --name=read_throughput_2 --numa_cpu_nodes=1
      

읽기 IOPS 테스트

I/O 블록 크기를 4KB로 설정하고 I/O 깊이를 256 이상으로 설정해서 무작위 읽기를 수행하여 읽기 IOPS를 테스트합니다.

  1. 하이퍼디스크에서 SCSI 인터페이스를 사용하는 경우:

    sudo fio --directory=$TEST_DIR \
    --numjobs=16 --size=10G --time_based \
    --runtime=5m --ramp_time=10s --ioengine=libaio \
    --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randread \
    --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
    --name=read_iops
    
  2. 하이퍼디스크에서 NVMe 인터페이스를 사용하는 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 --size=10G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randread \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --cpus_allowed_policy=split \
      --group_reporting \
      --name=read_iops --cpus_allowed=$QUEUE_1_CPUS \
      --name=read_iops_2 --cpus_allowed=$QUEUE_2_CPUS
      
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

      sudo fio --directory=$TEST_DIR --numjobs=8 --size=10G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randread \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --group_reporting \
      --name=read_iops --numa_cpu_nodes=0 \
      --name=read_iops_2 --numa_cpu_nodes=1
      

삭제

테스트 디렉터리를 삭제합니다.

sudo rm $TEST_DIR/write* $TEST_DIR/read*

C3 VM에서 Hyperdisk Extreme을 위한 IOPS 및 처리량 벤치마킹

Google Cloud Hyperdisk Extreme은 176개의 vCPU를 사용하여 C3 VM에서 더 높은 성능을 제공합니다. 더 높은 성능 한도에 도달하기 위해서는 VM에 여러 Hyperdisk Extreme 볼륨을 연결해야 합니다.

기존 데이터 디스크의 콘텐츠를 손실하지 않고 실행 중인 C3 VM에서 활성 디스크에 대해 실제 워크로드의 초당 I/O(IOPS) 또는 처리량을 측정하려면 기존 파일 시스템에서 새 디렉터리에 대해 벤치마크를 수행하고 벤치마킹 태스크를 위해 VM에 새 Hyperdisk Extreme 볼륨을 연결합니다.

NVMe 인터페이스로 연결된 디스크의 경우 VM에 제공되는 모든 NVMe 큐에 I/O 워크로드를 배포하는 것이 좋습니다. 이렇게 하면 하이퍼디스크 성능이 극대화됩니다. vCPU가 176개 있는 C3 VM에서는 4개의 NUMA 노드가 4개의 NVM2 큐에 일대일로 매핑됩니다. 이 매핑은 이 섹션에서 벤치마크 테스트용으로 간주됩니다.

테스트 준비

  1. VM에 새 Hyperdisk Extreme 디스크를 추가하고 하이퍼디스크 성능 한도를 고려해서 대상 성능에 필요한 디스크 설정을 파생합니다.

  2. 인스턴스에 연결합니다.

  3. 종속 항목을 설치합니다.

    sudo apt update
    sudo apt install -y fio
    
  4. VM에 연결된 디스크를 나열하고 테스트하려는 디스크를 찾습니다.

    sudo lsblk
    

    위 명령어는 다음과 비슷한 출력을 생성합니다.

    NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
    nvme0n1      259:0    0    10G  0 disk
    ├─nvme0n1p1  259:1    0   9.9G  0 part  /
    ├─nvme0n1p14 259:2    0     4M  0 part
    └─nvme0n1p15 259:3    0   106M  0 part  /boot/efi
    nvme0n2      259:4    0   2.5T  0 disk
    nvme0n3      259:5    0   2.5T  0 disk
    nvme0n4      259:6    0   2.5T  0 disk
    

    이 예시에서는 nvme0n2, nvme0n3, nvme0n4라는 디바이스가 포함된 3개의 2,500GiB Hyperdisk Extreme 볼륨에서 Google Cloud Hyperdisk 성능을 테스트합니다.

C3에서 Hyperdisk Extreme의 처리량 벤치마킹

이 섹션에서는 Hyperdisk Extreme 디스크의 읽기 및 쓰기 처리량을 모두 벤치마킹하는 방법을 보여줍니다.

테스트 준비

vCPU가 176개 있는 C3 VM에 연결된 Hyperdisk Extreme 디스크의 성능 벤치마킹을 시작하려면 먼저 다음 단계를 수행합니다.

  1. 운영체제에 fiotest라는 새 디렉터리를 만듭니다. 이 예시에서 루트 디렉터리는 /mnt/disks/mnt_dir입니다.

    TEST_DIR=/mnt/disks/mnt_dir/fiotest
    sudo mkdir -p $TEST_DIR
    
  2. 최고 성능 수준에 도달하기 위해서는 VM에 디스크가 여러 개 필요하기 때문에 단순성을 위해 모든 연결된 하이퍼디스크 볼륨에서 RAID 0을 수행합니다. 이렇게 하면 여러 하이퍼디스크 볼륨 간에 데이터를 더 쉽게 배포할 수 있습니다.

    이 예시에서 RAID 0은 C3 VM에 연결된 3개의 Hyperdisk Extreme 볼륨의 성능입니다.

    sudo mdadm --create /dev/md0 --level=0 --raid-devices=3 /dev/nvme0n2 /dev/nvme0n3 /dev/nvme0n4
    
  3. RAID 볼륨 /dev/md0포맷하고 마운트합니다.

쓰기 처리량 테스트

I/O 블록 크기를 1MiB로 설정하고 총 I/O 깊이를 NVMe 큐당 32 이상으로 설정한 상태로 여러 동시 스트림(16개 이상)에 순차적 쓰기를 수행하여 쓰기 처리량을 테스트합니다.

# Running this command causes data loss on the targeted file on the device.
# We strongly recommend using a throwaway disk.

sudo fio --name=global --group_reporting=1 --filesize=1024G \
--filename=$TEST_DIR/fiotestfile --numjobs=4 --size=64G \
--offset_increment=64G --time_based --runtime=5m \
--ramp_time=10s --ioengine=libaio --direct=1 --verify=0 \
--bs=1M --iodepth=8 --rw=write \
--name=write_throughput --numa_cpu_nodes=0 \
--name=write_throughput_1 --numa_cpu_nodes=1 \
--name=write_throughput_2 --numa_cpu_nodes=2 \
--name=write_throughput_3 --numa_cpu_nodes=3

읽기 처리량 테스트

I/O 블록 크기를 1MiB로 설정하고 총 I/O 깊이를 NVMe 큐당 32 이상으로 설정한 상태로 여러 동시 스트림(16개 이상)에 순차적 읽기를 수행하여 읽기 처리량을 테스트합니다.

sudo fio --name=global --group_reporting=1 --filesize=1024G \
--filename=$TEST_DIR/fiotestfile --numjobs=4 --size=64G \
--offset_increment=64G --time_based --runtime=5m \
--ramp_time=10s --ioengine=libaio --direct=1 \
--verify=0 --bs=1M --iodepth=8 --rw=read \
--name=read_throughput --numa_cpu_nodes=0 \
--name=read_throughput_1 --numa_cpu_nodes=1 \
--name=read_throughput_2 --numa_cpu_nodes=2 \
--name=read_throughput_3 --numa_cpu_nodes=3

C3에서 Hyperdisk Extreme의 IOPS 벤치마킹

초당 I/O(IOPS) 성능을 벤치마킹하려면 원시 디스크(RAID 제외)에 대해 직접 소규모 I/O 작업을 병렬로 수행하는 것이 좋습니다.

쓰기 IOPS 테스트

I/O 블록 크기를 4KiB로 설정하고 I/O 깊이를 256 이상으로 설정한 상태로 최소 2개 이상의 NVMe 큐를 사용해서 무작위 쓰기를 수행하여 쓰기 IOPS를 테스트합니다.

# Running this command causes data loss on the targeted device.
# We strongly recommend using a throwaway disk.

sudo fio --name=global --group_reporting=1 \
--directory=/ --bs=4K --direct=1 \
--filesize=512G --iodepth=256 \
--iodepth_batch_complete_max=256 --iodepth_batch_submit=256 \
--ioengine=libaio --numjobs=5 --ramp_time=10s \
--randrepeat=0 --runtime=5m --rw=randwrite \
--time_based=1 --verify=0 \
--name=write_iops_test --filename=/dev/nvme0n2 --numa_cpu_nodes=0 \
--name=write_iops_test_1 --filename=/dev/nvme0n3  --numa_cpu_nodes=1 \
--name=write_iops_test_2 --filename=/dev/nvme0n4 --numa_cpu_nodes=2

읽기 IOPS 테스트

I/O 블록 크기를 4KiB로 설정하고 I/O 깊이를 256 이상으로 설정한 상태로 최소 2개 이상의 NVMe 큐를 사용해서 무작위 읽기를 수행하여 읽기 IOPS를 테스트합니다.

sudo fio --name=global --group_reporting=1 --directory=/ \
--bs=4K --direct=1 --filesize=512G --iodepth=256 \
--iodepth_batch_complete_max=256 --iodepth_batch_submit=256 \
--ioengine=libaio --numjobs=5 --ramp_time=10s \
--randrepeat=0 --runtime=5m --rw=randread \
--time_based=1 --verify=0 \
--name=read_iops_test --filename=/dev/nvme0n2 --numa_cpu_nodes=0 \
--name=read_iops_test_1 --filename=/dev/nvme0n3  --numa_cpu_nodes=1 \
--name=read_iops_test_2 --filename=/dev/nvme0n4 --numa_cpu_nodes=2

C3에서 Hyperdisk Extreme의 지연 시간 벤치마킹

I/O 지연 시간을 테스트할 때는 VM이 최대 대역폭 또는 IOPS에 도달하지 않아야 합니다. 그렇더라도 관측된 지연 시간에는 실제 하이퍼디스크 I/O 지연 시간이 반영되지 않습니다. 예를 들어 VM이 I/O 깊이 30에서 IOPS 한도에 도달하고 fio 명령어로 깊이가 두 배로 늘었다면 총 IOPS가 동일하게 유지되고 보고된 I/O 지연 시간이 두 배로 증가합니다.

실제 I/O 지연 시간을 얻기 위해서는 단일 원시 디스크 디바이스를 직접 대상으로 지정하는 것으로 충분합니다.

쓰기 지연 시간 테스트

I/O 블록 크기를 4KiB로 설정하고 I/O 깊이를 4로 설정한 상태로 무작위 쓰기를 수행하여 쓰기 지연 시간을 테스트합니다.

# Running this command causes data loss on the targeted device.
# We strongly recommend using a throwaway disk.

sudo fio --filename=/dev/nvme0n2  \
--filesize=512G --time_based \
--runtime=5m --ramp_time=10s --ioengine=libaio \
--direct=1 --verify=0 --bs=4K --iodepth=4 --rw=randwrite \
--iodepth_batch_submit=4 --iodepth_batch_complete_max=4 \
--name=write_latency

읽기 지연 시간 테스트

I/O 블록 크기를 4KiB로 설정하고 I/O 깊이를 4로 설정한 상태로 무작위 읽기를 수행하여 읽기 지연 시간을 테스트합니다.

sudo fio --filename=/dev/nvme0n2  \
--filesize=512G --time_based \
--runtime=5m --ramp_time=10s --ioengine=libaio \
--direct=1 --verify=0 --bs=4K --iodepth=4 --rw=randread \
--iodepth_batch_submit=4 --iodepth_batch_complete_max=4 \
--name=read_latency

삭제

  1. 테스트 파일을 삭제합니다.

    sudo rm -rf $TEST_DIR/*
    
  2. RAID 볼륨을 마운트 해제하고 중지합니다.

    sudo umount /dev/md0
    sudo mdadm --stop /dev/md0
    
  3. 연결된 Hyperdisk 볼륨을 분리하고 삭제합니다. gcloud compute instances detach-diskgcloud compute disks delete 명령어를 참조하세요.

원시 하이퍼디스크 성능 벤치마킹

개발 환경 밖에서 하이퍼디스크 볼륨의 성능만 측정하려면 폐기 디스크 및 VM에서 블록 기기의 읽기 및 쓰기 성능을 테스트할 수 있습니다.

다음 명령어는 VM에 연결된 하이퍼디스크 익스트림 볼륨이 3,500GiB라고 가정합니다. 이 디스크 크기는 vCPU가 32개인 VM의 처리량 한도를 달성하는 데 필요합니다. 기기 크기가 다르면 다음 명령어에서 --filesize 인수 값을 수정합니다. VM 머신 유형의 성능 한도에 대한 자세한 내용은 머신 유형 지원을 참조하세요.

테스트 준비

  1. 인스턴스에 연결

  2. 종속 항목을 설치합니다.

    sudo apt-get update
    sudo apt-get install -y fio
    
  3. 원시 디스크의 경로를 가져옵니다. 변수에 경로를 저장합니다. 다음 예시에서는 /dev/nvme0n2를 원시 디스크 경로로 사용합니다.

    TEST_DIR=/dev/nvme0n2
    
  4. 디스크를 0이 아닌 데이터로 채웁니다. 빈 블록에서의 하이퍼디스크 읽기는 데이터를 포함하는 블록에서의 읽기와 지연 시간 프로필이 다릅니다. 모든 읽기 지연 시간 벤치마크를 실행하기 전에 디스크를 채우는 것이 좋습니다.

    # Running this command causes data loss on the second device.
    # We strongly recommend using a throwaway VM and disk.
    
    sudo fio --name=fill_disk \
    --filename=$TEST_DIR --filesize=2500G \
    --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \
    --bs=128K --iodepth=64 --rw=randwrite \
    --iodepth_batch_submit=64  --iodepth_batch_complete_max=64
    
  5. 하이퍼디스크 연결을 위해 VM에 NVMe 디스크 인터페이스가 사용되는 경우(원시 디스크 이름에 nvme 프리픽스가 사용된 경우) 다음 단계를 수행하여 VM에 사용 가능한 NUMA 노드 수를 가져옵니다.

    NUMA 노드가 하나만 있는 VM과 NUMA 노드가 한 개 넘게 있는 VM은 NVMe 디스크의 벤치마킹 전략이 서로 다릅니다. NVMe 디스크 인터페이스를 사용하여 하이퍼디스크 성능을 테스트할 때는 큐당 256의 NVMe 큐 크기만 할당됩니다. 사용 가능한 NVMe 큐 크기가 제한적이고 동일한 VM에 연결된 다른 디스크와 콘텐츠 경합 가능성이 있기 때문에 이러한 벤치마크 테스트에서는 256 I/O 깊이를 처리할 수 있는 집계된 큐 크기를 유지하기 위해 2개의 NVMe 디스크 큐를 사용합니다.

    1. NUMA 노드 수를 가져옵니다.

      lscpu | grep -i 'numa node(s)' | awk '{print $NF}'
      
    2. VM에 NUMA 노드가 1개만 있으면 CPU-NVMe 큐 매핑을 가져옵니다. 이 정보는 나중에 --cpus-allowed 매개변수에 사용됩니다.

      QUEUE_1_CPUS=$(cat /sys/class/block/nvme0n2/mq/*/cpu_list | sed -n 1p | tr -d " \t")
      QUEUE_2_CPUS=$(cat /sys/class/block/nvme0n2/mq/*/cpu_list | sed -n 2p | tr -d " \t")
      

쓰기 처리량 테스트

I/O 크기를 1MB로 사용하고 I/O 깊이를 64 이상으로 설정하여 여러 동시 스트림(16개 이상)에 순차적 쓰기를 수행하여 쓰기 처리량을 테스트합니다.

  1. 하이퍼디스크가 SCSI 인터페이스를 사용하여 연결된 경우:

    # Running this command causes data loss on the second device.
    # We strongly recommend using a throwaway VM and disk.
    
    sudo fio --filename=$TEST_DIR \
    --numjobs=16 --size=500G --time_based \
    --runtime=5m --ramp_time=10s --ioengine=libaio \
    --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=write \
    --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
    --offset_increment=20G \
    --name=write_throughput
    
  2. 하이퍼디스크에서 NVMe 인터페이스를 사용하는 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

      # Running this command causes data loss on the second device.
      # We strongly recommend using a throwaway VM and disk.
      
      sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=write \
      --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
      --cpus_allowed_policy=split \
      --offset_increment=20G --group_reporting \
      --name=write_throughput --cpus_allowed=$QUEUE_1_CPUS \
      --name=write_throughput_2 --cpus_allowed=$QUEUE_2_CPUS
      
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

      # Running this command causes data loss on the second device.
      # We strongly recommend using a throwaway VM and disk.
      
      sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=write \
      --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
      --offset_increment=20G --group_reporting \
      --name=write_throughput --numa_cpu_nodes=0 \
      --name=write_throughput_2 --numa_cpu_nodes=1
      

쓰기 IOPS 테스트

최대 하이퍼디스크 IOPS를 달성하기 위해서는 깊은 I/O 큐를 유지해야 합니다. 예를 들어 쓰기 지연 시간이 1밀리초인 경우 VM이 처리 중인 각 I/O에 대해 최대 1,000의 IOPS를 달성할 수 있습니다. 15,000 쓰기 IOPS를 달성하기 위해서는 VM이 처리 중인 I/O 작업을 최소한 15 이상으로 유지해야 합니다. 디스크 및 VM이 30,000 쓰기 IOPS를 달성할 수 있는 경우 처리되는 I/O 작업 수가 최소 30 이상이어야 합니다. I/O 크기가 4KB보다 큰 경우에는 IOPS 한도에 도달하기 전에 VM이 대역폭 제한에 걸릴 수 있습니다.

I/O 블록 크기를 4KB로 설정하고 I/O 깊이를 256 이상으로 설정한 상태로 무작위 쓰기를 수행하여 쓰기 IOPS를 테스트합니다.

  1. 하이퍼디스크 익스트림 볼륨이 SCSI 인터페이스를 사용하여 연결된 경우:

    # Running this command causes data loss on the second device.
    # We strongly recommend using a throwaway VM and disk.
    
    sudo fio --filename=$TEST_DIR \
    --numjobs=16 --size=500G -time_based \
    --runtime=5m --ramp_time=10s --ioengine=libaio \
    --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randwrite \
    --iodepth_batch_submit=256  --iodepth_batch_complete_max=256 \
    --name=write_iops
    
  2. 하이퍼디스크 익스트림 볼륨이 NVMe 인터페이스를 사용하여 연결된 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

      # Running this command causes data loss on the second device.
      # We strongly recommend using a throwaway VM and disk.
      
      sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randwrite \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --cpus_allowed_policy=split \
      --group_reporting \
      --name=write_write_iops --cpus_allowed=$QUEUE_1_CPUS \
      --name=write_write_iops_2 --cpus_allowed=$QUEUE_2_CPUS
      
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

      # Running this command causes data loss on the second device.
      # We strongly recommend using a throwaway VM and disk.
      
      sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randwrite \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --group_reporting \
      --name=write_iops --numa_cpu_nodes=0 \
      --name=write_iops_2 --numa_cpu_nodes=1
      

쓰기 지연 시간 테스트

I/O 지연 시간을 테스트할 때는 VM이 최대 대역폭 또는 IOPS에 도달하지 않아야 합니다. 그렇지 않으면 관찰된 지연 시간에 실제 하이퍼디스크 I/O 지연 시간이 반영되지 않습니다. 예를 들어 I/O 깊이 30에서 IOPS 제한에 도달하고 fio 명령어 시간이 두 배가 될 경우, 총 IOPS는 동일하게 유지되고 보고되는 I/O 지연 시간이 두 배가 됩니다.

# Running this command causes data loss on the second device.
# We strongly recommend using a throwaway VM and disk.
sudo fio --filename=$TEST_DIR \
--filesize=500G --time_based \
--runtime=5m --ramp_time=10s --ioengine=libaio \
--direct=1 --verify=0 --bs=4K --iodepth=4 --rw=randwrite \
--iodepth_batch_submit=4 --iodepth_batch_complete_max=4 \
--name=write_latency

읽기 대역폭 테스트

I/O 크기를 1MB로 설정하고 I/O 깊이를 최소 64 이상으로 설정한 상태로 여러 동시 스트림(16개 이상)에 순차적 읽기를 수행하여 읽기 대역폭을 테스트합니다.

  1. 하이퍼디스크 익스트림 볼륨이 SCSI 인터페이스를 사용하여 연결된 경우:

     sudo fio --filename=$TEST_DIR \
     --numjobs=16 --size=500G --time_based \
     --runtime=5m --ramp_time=10s --ioengine=libaio \
     --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=read \
     --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
     --offset_increment=20G --name=read_bandwidth
  2. 하이퍼디스크 익스트림 볼륨이 NVMe 인터페이스를 사용하여 연결된 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

        sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
        --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
        --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=read \
        --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
        --cpus_allowed_policy=split \
        --offset_increment=20G --group_reporting \
        --name=read_bandwidth --cpus_allowed=$QUEUE_1_CPUS \
        --name=read_bandwidth_2 --cpus_allowed=$QUEUE_2_CPUS
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

        sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
        --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
        --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=read \
        --iodepth_batch_submit=64 --iodepth_batch_complete_max=64 \
        --offset_increment=20G --group_reporting \
        --name=read_bandwidth --numa_cpu_nodes=0 \
        --name=read_bandwidth_2 --numa_cpu_nodes=1

읽기 IOPS 테스트

최대 하이퍼디스크 IOPS를 달성하기 위해서는 깊은 I/O 큐를 유지해야 합니다. 예를 들어 I/O 크기가 4KB보다 큰 경우에는 IOPS 한도에 도달하기 전에 VM이 대역폭 제한에 걸릴 수 있습니다. 머신 유형에 사용할 수 있는 최대 읽기 IOPS를 달성하려면 테스트에 --iodepth=256을 지정합니다.

  1. 하이퍼디스크 익스트림 볼륨이 SCSI 인터페이스를 사용하여 연결된 경우:

    sudo fio --filename=$TEST_DIR \
    --numjobs=16 --size=500G --time_based \
    --runtime=5m --ramp_time=10s --ioengine=libaio \
    --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randread \
    --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
    --name=read_iops
    
  2. 하이퍼디스크 익스트림 볼륨이 NVMe 인터페이스를 사용하여 연결된 경우:

    1. VM에 NUMA 노드가 1개만 있으면 다음 명령어를 사용합니다.

      sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randread \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --cpus_allowed_policy=split \
      --group_reporting \
      --name=read_iops --cpus_allowed=$QUEUE_1_CPUS \
      --name=read_iops_2 --cpus_allowed=$QUEUE_2_CPUS
      
    2. VM에 NUMA 노드가 1개 넘게 있으면 다음 명령어를 사용합니다.

      sudo fio --filename=$TEST_DIR --numjobs=8 --size=500G \
      --time_based --runtime=5m --ramp_time=10s --ioengine=libaio \
      --direct=1 --verify=0 --bs=4K --iodepth=256 --rw=randread \
      --iodepth_batch_submit=256 --iodepth_batch_complete_max=256 \
      --group_reporting \
      --name=read_iops --numa_cpu_nodes=0 \
      --name=read_iops_2 --numa_cpu_nodes=1
      

읽기 지연 시간 테스트

실질적으로 지연 시간을 측정하기 위해서는 디스크에 데이터를 채우는 것이 중요합니다. 하이퍼디스크 볼륨이 포화 한도에 도달한 후 수신 I/O 작업이 푸시백되기 때문에 이 테스트 중에는 VM이 IOPS 또는 처리량 한도에 도달하지 않도록 하는 것이 중요합니다. 이러한 푸시백은 I/O 지연 시간에서 인위적인 증가로 반영됩니다.

 sudo fio --filename=$TEST_DIR \
 --filesize=500G --time_based \
 --runtime=5m --ramp_time=10s --ioengine=libaio \
 --direct=1 --verify=0 --bs=4K --iodepth=4 --rw=randread \
 --iodepth_batch_submit=4 --iodepth_batch_complete_max=4 \
 --name=read_latency

삭제

권장사항에 따라 폐기 디스크와 VM을 사용한 경우 벤치마크 테스트를 완료한 후 다음을 수행할 수 있습니다.

  • 디스크를 분리하고 삭제합니다.
  • VM을 삭제합니다.

다음 단계