vieyahn2017 / storage_persist

storage_persist
0 stars 0 forks source link

Kubernetes 中 Ceph、LINSTOR、Mayastor 和 Vitastor 存储性能对比 #7

Open vieyahn2017 opened 6 months ago

vieyahn2017 commented 6 months ago

Kubernetes 中 Ceph、LINSTOR、Mayastor 和 Vitastor 存储性能对比 https://blog.csdn.net/NewTyun/article/details/129076562

vieyahn2017 commented 6 months ago

通常情况下,我们需要为 Kubernetes 平台找到一种易于使用、可靠的块存储。因此,本文将对几个开源存储解决方案进行基准测试,以了解它们在各种条件下的性能。本次对比也是在不同硬件配置条件下对DRBD(https://en.wikipedia.org/wiki/Distributed_Replicated_Block_Device) 进行测试以及与 Ceph (https://ceph.io/en/) 的测试结果比较。然而,软件定义存储市场在不断发展和演变。新的项目不断的涌现,包括最近发布的 Mayastor (https://github.com/openebs/mayastor) 和 Vitastor (https://vitastor.io/) 。本文也包含了这两种新兴存储。

vieyahn2017 commented 6 months ago

主要软件版本 DRBD:9.1.4 (linstor-server v1.17.0); Ceph:16.2.7 (rook v1.8.2); Mayastor:1.0.0; Vitastor:0.6.12 (kernel 5.13.0-27-generic); ZFS: 0.8.3; LVM:2.03.07

vieyahn2017 commented 6 months ago

基准测试基准测试分几个步骤进行: 测试“原始”NVMe 驱动器的性能; 测试后端开销(LVM vs LVMThin vs ZFS); 测试 DRBD 开销; 与其他集群文件系统比较; 通过千兆网络进行基准测试; 压力测试。

vieyahn2017 commented 6 months ago

基于这些信息,本文提供了一个脚本 (https://gist.github.com/kvaps/e36b82826fb8e36d0362c7f4033948d0) 来运行每个测试,然后收集并解析获得的数据。请注意,以下所有图表均基于上面列出的八项测试。每个测试只运行一分钟。当然,这些时间不足以完全探索所有的细微之处,但对于不同解决方案的一般比较来说已经足够了。

vieyahn2017 commented 6 months ago

#!/bin/sh

run(){
  name="$1"
  shift
  (
    set -x
    # defailt parameters
    fio -name="$name" -filename=$disk -output-format=json -ioengine=libaio -direct=1 -randrepeat=0 "$@" > results/$disk_dashed-$name.json
  )
}

if [ ! -b "$1" ]; then
  echo "$1 is not a device!" >&2
  exit 1
fi
command -V fio >&2 || exit $?
command -V jq >&2 || exit $?

disk=$1
disk_dashed=$(echo "$disk" | tr / - | sed 's/^-//')

mkdir -p results
rm -f results/$dashed_disk-*

# name should be 'randread_*', 'read_*', 'randwrite_*' or 'write_*'
run randwrite_fsync -rw=randwrite -runtime=60 -bs=4k -numjobs=1 -iodepth=1   -fsync=1
run randwrite_jobs4 -rw=randwrite -runtime=60 -bs=4k -numjobs=4 -iodepth=128 -group_reporting
run randwrite       -rw=randwrite -runtime=60 -bs=4k -numjobs=1 -iodepth=128
run write           -rw=write     -runtime=60 -bs=4M -numjobs=1 -iodepth=16
run randread_fsync  -rw=randread  -runtime=60 -bs=4k -numjobs=1 -iodepth=1   -fsync=1
run randread_jobs4  -rw=randread  -runtime=60 -bs=4k -numjobs=4 -iodepth=128 -group_reporting
run randread        -rw=randread  -runtime=60 -bs=4k -numjobs=1 -iodepth=128
run read            -rw=read      -runtime=60 -bs=4M -numjobs=1 -iodepth=16

data="$(cat results/$disk_dashed-* | jq -sc . | gzip -9 | base64 -w0)"

{
for i in $(find results -name "$disk_dashed-write*" -o -name "$disk_dashed-randwrite*" | sort -V); do
    cat $i | jq -rc '.jobs[0] | {"name": ."job options".name, "iodepth": ."job options".iodepth, bs: ."job options".bs, jobs: ."job options".numjobs, "clat_ms": (.write.clat_ns.mean/1000)|floor, "bw_mbs": (.write.bw_mean/1024)|floor, iops: .write.iops_mean|floor}'
done

for i in $(find results -name "$disk_dashed-read*" -o -name "$disk_dashed-randread*" | sort -V); do
  cat $i | jq -rc '.jobs[0] | {"name": ."job options".name, "iodepth": ."job options".iodepth, bs: ."job options".bs, jobs: ."job options".numjobs, "clat_ms": (.read.clat_ns.mean/1000)|floor, "bw_mbs": (.read.bw_mean/1024)|floor, iops: .read.iops_mean|floor}'
done
} | jq -s "{\"$disk\": {results: ., data: \"$data\" }}"

rm -f results/$disk_dashed-*
vieyahn2017 commented 6 months ago

简单总结根据基准测试结果,基于当前的配置信息: LINSTOR 是最快的存储解决方案之一。 Vitastor 紧随其后,后者(如果考虑其类似 Ceph 的架构)看起来很有前途。例如,这将允许在所有集群节点之间分配单个块设备的负载。 Mayastor 性能也不错,但目前它的功能比较少。如果客户端数量很多,同等配置的 LINSTOR 会更快。 Ceph 消耗比较多的硬件资源(通常看这些可能会是瓶颈)。 目前,开发人员正在开发一个新的 Crimson (https://www.youtube.com/watch?v=YxbT5MneEL0) 后端——当它发布时,我们希望在这方面会有所改善。 对于我们的案例,LINSTOR 被选为最成熟的生产就绪解决方案。 原文:https://blog.palark.com/kubernetes-storage-performance-linstor-ceph-mayastor-vitastor/