Alluxio Enterprise AI on K8s FIO 测试教程

fio是业内常用的磁盘与文件系统性能测试工具,下面内容将通过文字方式介绍Alluxio on k8s 进行fio测试的教程。

1. 测试环境

  • 虚拟机规格 :ecs.g3i.16xlarge,包含 64 vCPU、256GB 内存、140GB 磁盘(极速型 SSD FlexPL)。带宽等详细数据见实例规格
  • Alluxio 版本:3.2-5.2.1
  • Alluxio Operator 版本:1.3.0

2. 测试环境准备

确保已经在云端kubernetes集群上搭建了Alluxio集群,集群中已启动以下pod,集群部署和启动方式详见《Alluxio on K8s部署教程》

  • 1 个 Coordinator pod

  • 2 个 Worker pod

  • 1 个 FUSE pod

    • 在业务pod启动时被自动拉起,和业务pod被分配在同一个node
  • 1 个业务pod

2.1 集群配置

下面是alluxio集群的yaml文件配置内容。

注意1 :etcd需要配置storageClass字段。不同云厂商的容器服务提供不同的storage class类型。如何配置,详见《Alluxio on K8s 部署教程》Alluxio on K8s FAQ。如果不清楚当前云厂商容器服务的storage class类型,请执行kubectl get sc查看。如果您只是进行部署验证,同时当前没有方便的 storage class 供集群使用,您可以关闭 etcd 的 persistence 配置,如下。注意该配置无法适用于生产,仅供验证测试使用。

yaml 复制代码
etcd:
  persistence:
    enabled: false

注意2:集群的默认配置会部署1个 coordinator、2 个 worker、1 套 3 节点 etcd,同时启动 pvc 的 pod 过程中会自动创建 fuse 相关 pod,请谨慎配置这些相关 pod 的 request 资源,以免相应 pod 无法调度成功。

yaml 复制代码
apiVersion: k8s-operator.alluxio.com/v1
kind: AlluxioCluster
metadata:
  name: alluxio
spec:
  image: k8s-alluxio-cn-beijing.cr.volces.com/alluxio-test/alluxio-enterprise
  imageTag: AI-3.2-5.2.1
  user: 0
  group: 0

  worker:
    count: 2
    resources:
      limits:
        cpu: "16"
        memory: "32Gi"
      requests:
        cpu: "0"
        memory: "512Mi"
    jvmOptions:
      - "-Xmx16g"
      - "-Xms16g"
      - "-XX:MaxDirectMemorySize=12g"

  fuse:
    type: csi
    resources:
      requests:
        cpu: "0"
        memory: "2Gi"
      limits:
        cpu: "32"
        memory: "16Gi"
    jvmOptions:
      - "-Xms24g"
      - "-Xmx24g"
      - "-XX:MaxDirectMemorySize=16g"

  etcd:
    enabled: true
    replicaCount: 1
    persistence:
      storageClass: ebs-ssd
      size: 30Gi


    image:
      registry: k8s-alluxio-cn-beijing.cr.volces.com
      repository: alluxio-test/etcd
      tag: 3.5.9-debian-11-r24
    volumePermissions:
      image:
        registry: k8s-alluxio-cn-beijing.cr.volces.com
        repository: alluxio-test/os-shell
        tag: 11-debian-11-r2

  alluxio-monitor:
    enabled: true
    prometheus:
      imageInfo:
        image: k8s-alluxio-cn-beijing.cr.volces.com/alluxio-test/prometheus
        imageTag: v2.52.0
    grafana:
      imageInfo:
        image: k8s-alluxio-cn-beijing.cr.volces.com/alluxio-test/grafana
        imageTag: 11.1.0-ubuntu
  pagestore:
    quota: 10Gi

2.2 业务pod环境配置

下面是业务pod的yaml文件配置内容。此处yaml文件的image字段可以任意指定一个镜像。如果是国内用户,确保指定的镜像可以被集群拉取到即可。

yaml 复制代码
apiVersion: v1
kind: Pod
metadata:
  name: fuse-test-0
  labels:
    app: alluxio
spec:
  containers:
    - image: k8s-alluxio-cn-beijing.cr.volces.com/alluxio-test/grafana:11.1.0-ubuntu
      imagePullPolicy: IfNotPresent
      name: fuse-test
      command: ["/bin/sh", "-c"]
      args:
        - sleep infinity
      volumeMounts:
        - mountPath: /data
          name: alluxio-pvc
          mountPropagation: HostToContainer
      securityContext:
        runAsUser: 0
        runAsGroup: 0
  volumes:
    - name: alluxio-pvc
      persistentVolumeClaim:
        claimName: alluxio-alluxio-csi-fuse-pvc
    
  nodeSelector:
    kubernetes.io/hostname: 172.31.16.6

如果fuse pod和worker pod被分配到了同一个node,那么数据并不会通过网络传输,会导致测试结果不准确。为了保证fuse pod与worker pod分配在不同的node,请使用最后两行来指定一个node,在其上分配fuse pod和业务pod。此处填入的值为kubectl get node看到的node name。此处为将该pod分配到名为172.31.16.6的node。

在业务pod上进行 fio 测试之前,需要进行以下配置:

  1. 更新并安装依赖:

    sql 复制代码
    apt-get update && apt install -y libaio-dev fio openssh-server
  2. 启动 SSH 服务:

    sql 复制代码
    service ssh start
  3. 配置免密登录,使业务pod可以免密登录到宿主机,便于清理 Kernel 缓存。

3. 测试流程

使用 fio 对 Alluxio 文件系统进行读操作的性能测试,具体步骤如下:

3.1 准备数据

首先,登陆进任意一个woker pod,使用 Alluxio 的 job 命令将测试数据加载到 Worker 节点上。例如,此处的测试数据为tos://tos-k8s-alluxio-test/5G,其为通过dd命令生成并上传的一个5GB大小的文件:

lua 复制代码
alluxio job load --path tos://tos-k8s-alluxio-test/5G --submit
alluxio job load --path tos://tos-k8s-alluxio-test/5G --progress

使用--submit提交数据load命令,使用--progress查看数据load进度。当--progress返回Job State: SUCCEEDED时,说明测试数据已经load完成,接下来通过alluxio-fuse的读操作都是热读。

3.2(重要)在每次测试前清理 Kernel Cache

在执行每次测试前,都需要清除 Kernel Cache ,避免Linux kernel cache对测试结果的干扰。使用以下命令在宿主机上清除Kernel Cache:

arduino 复制代码
sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'

3.3 执行顺序热读测试

3.3.1 -bs=4K 顺序热读

使用以下命令测试 4K 顺序热读性能:

bash 复制代码
fio -iodepth=1 -rw=read -ioengine=libaio -bs=4K -numjobs=1 -group_reporting -size=5G -filename=/data/tos/5G -name=read_test --readonly -direct=1 --invalidate=1

3.3.2 -bs=256K 顺序热读

清除 Kernel Cache后,使用以下命令测试 256K 顺序热读性能:

bash 复制代码
fio -iodepth=1 -rw=read -ioengine=libaio -bs=256K -numjobs=1 -group_reporting -size=5G -filename=/data/tos/5G -name=read_test --readonly -direct=1 --invalidate=1

3.4 执行随机热读测试

3.4.1 -bs=4K 随机热读

再次清理 Kernel Cache后,执行 4K 随机热读测试:

typescript 复制代码
fio -iodepth=1 -rw=randread -ioengine=libaio -bs=4K -numjobs=1 -group_reporting -size=5G -filename=/data/tos/5G -name=read_test --readonly -direct=1 --invalidate=1

3.4.2 -bs=256K 随机热读

清理 Kernel Cache后,执行 256K 随机热读测试:

typescript 复制代码
fio -iodepth=1 -rw=randread -ioengine=libaio -bs=256K -numjobs=1 -group_reporting -size=5G -filename=/data/tos/5G -name=read_test --readonly -direct=1 --invalidate=1

通过以上步骤,能够评估 Alluxio 文件系统在不同读写场景下的性能表现,并得到相应的数据支持。

视频中的实际测试结果显示,当batch size为256k,顺序热读场景下,fio 单线程 读吞吐可达2924MB/s。增大线程数(numjobs)到32,64,可以得到更高的fio测试性能。关于更多测试结果,请点击官网性能测试

相关推荐
5pace7 分钟前
机器学习(西瓜书)第 14 章 概率图模型
人工智能·机器学习
Linux猿10 分钟前
828华为云征文 | 云服务器Flexus X实例:部署 AgentOps,全方位监测智能体
人工智能·华为云·agent·autogen·flexus云服务器x实例·华为云服务器·agentops
Rense127 分钟前
开源RK3588 AI Module7,并与Jetson Nano生态兼容的低功耗AI模块
人工智能·开源
FL162386312943 分钟前
[数据集][目标检测]不同颜色的安全帽检测数据集VOC+YOLO格式7574张5类别
人工智能·yolo·目标检测
QuantumYou1 小时前
计算机视觉 对比学习 串烧二
人工智能·学习·计算机视觉
阿利同学1 小时前
热成像目标检测数据集
人工智能·目标检测·机器学习·目标跟踪·数据集·热成像目标检测数据集·机器学习 深度学习
拥抱AGI1 小时前
我说大模型微调没啥技术含量,谁赞成谁反对?
人工智能·学习·语言模型·大模型学习·大模型入门·大模型教程
aqymnkstkw1 小时前
2024年【电气试验】考试题库及电气试验模拟试题
大数据·c语言·人工智能·嵌入式硬件·安全
2401_8504404971 小时前
激发AI创造力:掌握Prompt提示词的高效提问方法
人工智能·prompt
Terry Cao 漕河泾2 小时前
SRT3D: A Sparse Region-Based 3D Object Tracking Approach for the Real World
人工智能·计算机视觉·3d·目标跟踪