惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cyberwarzone
Cyberwarzone
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
U
Unit 42
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
I
InfoQ
AI
AI
Webroot Blog
Webroot Blog
Forbes - Security
Forbes - Security
The GitHub Blog
The GitHub Blog
F
Full Disclosure
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
大猫的无限游戏
大猫的无限游戏
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
博客园_首页
S
SegmentFault 最新的问题
H
Help Net Security
A
About on SuperTechFans
Project Zero
Project Zero
Recent Commits to openclaw:main
Recent Commits to openclaw:main
爱范儿
爱范儿
Jina AI
Jina AI
H
Hacker News: Front Page
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
IT之家
IT之家
博客园 - 【当耐特】
腾讯CDC
博客园 - 聂微东
Latest news
Latest news
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
S
Schneier on Security
Spread Privacy
Spread Privacy
博客园 - 三生石上(FineUI控件)
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
O
OpenAI News
Help Net Security
Help Net Security

陈少文的网站

巨变与机遇的未来十年 Kubernetes 平台管理软件压力测试方案 使用镜像部署 Hexo 静态页面 终于等到你 - GitHub 镜像仓库服务(ghcr.io) 一起来学 Go --(6)Interface 一起来学 Go --(5)Goroutine 和 Channel 什么是函数式编程 如何在 Kubernetes 集群集成 Kata 柯里化与偏函数 使用 PyGithub 自动创建 Label 软件产品是团队能力的输出 Helm 2 、Helm 3 比较 IoT 变现 Kubernetes 中的 DNS 服务 国内的 Helm 镜像源 Harbor 使用自签证书支持 Https 访问 DevOps 工具链之 Prow 如何使用 kfctl 安装 Kubeflow VS Code 无法下载 Go 插件的工具包 工程师更应具有服务精神 你不知道的 Docker 使用技巧 使用 Docker 运行 Tensorflow 论中国 什么是左移 如何清空 Git 仓库全部历史记录 一禅小和尚 有风吹过厨房 时间的玫瑰 如何在 CentOS 安装 GPU 驱动 开发 Tips(19) 使用 Velero 备份 Kubernetes 集群 Kubernetes Cheat Sheet 开发 Tips(18) 如何构建一个 Java 工程 开发 Tips(17) KubeSpray 安装 Kubernetes 报错 ip in ansible_all_ipv4_addresses 基于 Kubernetes 和 Jenkins 搭建自动化测试系统 在 Kubernetes 上动态创建 Jenkins Slave 使用 Jenkins 进行服务拨测 开发 Tips(16) Kubernetes 签发 Ingress 证书及日常故障运维 Kubernetes 中 Deployment 的基本操作 Kubernetes 中的证书 如何使用 KubeBuilder 开发一个 Operator Kubernetes 1.6.0 安装问题汇总 镜像管理工具 -- Harbor 开发 Tips(15) Docker 如何拉取镜像 开发 Tips(14) 使用 Helm 安装 harbor 开发 Tips(13) 使用 S2I 构建云原生应用 在 Kubernetes 中使用 emptyDir、hostPath、localVolume 开发 Tips(12) 开发 Tips(11) 代码质量分析工具 SonarQube 使用 Kubeadm 安装 Kubernetes 集群 一起来学 Go --(4)常用函数 Kubernetes 中的 Ceph Kubernetes 之 Volumes Kubernetes 之 Labels、Selectors 开发 Tips(10) 开源正在重构商业模式 Kubernetes 之网络 Kubernetes 之 API 使用 Helm 和 Operator 快速部署 Prometheus Kubernetes 复杂有状态应用管理框架 -- Operator Kubernetes 的包管理器 -- Helm 一起来学 Go --(3)Go Modules 如何一步一步地优化博客方案 kubectl 实用指南 Kubernetes 中的基本概念 搭建远程 Kubernetes 开发环境 大公司和小公司的 ToB 思路 开发 Tips(9) Go 入门指南 一起来学 Go --(2)数据与逻辑结构 如何预防 Web 富文本中的 XSS 攻击 django-xss-cleaner 云工作时代 一起来学 Go --(1)背景与特点 SaaS 开发团队的不同阶段 你不知道的 Git 使用技巧 输出既服务 微服务设计 继续奔跑 开发 Tips(8) 从账户安全到二次验证 Django 性能之数据库查询优化 Django 性能之分库分表 敏捷开发之研发流程 打造一致性的团队 开发 Tips(7) Pytest 进阶学习之 Mock PaaS 部署之 buildpack Go 开发配置 领域输出才是 PaaS 的核心竞争力 Pytest 入门学习 开发 Tips(6) 如何使用 Jenkins、Docker、GitLab 搭建 Django 自动化部署流程
Fluid 使用 NFS Runtime 以及性能测试
微信公众号 · 2024-05-14 · via 陈少文的网站

1. 创建 Dataset

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
  name: nfs-demo
spec:
  mounts:
  - mountPoint: x.x.x.x:/x-x/
    name: nfs-demo
EOF

2. 创建 Runtime

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: ThinRuntimeProfile
metadata:
  name: nfs
spec:
  fileSystemType: nfs
  fuse:
    image: fluidcloudnative/nfs
    imageTag: v0.1
    imagePullPolicy: IfNotPresent
    command:
      - "/usr/local/bin/entrypoint.sh"
EOF
1
2
3
4
5
6
7
8
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: ThinRuntime
metadata:
  name: nfs-demo
spec:
  profileName: nfs
EOF

3. 创建测试 Pod

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: nfs-demo
spec:
  containers:
    - name: nfs-demo
      image: shaowenchen/demo:ubuntu
      volumeMounts:
        - mountPath: /data
          name: nfs-demo
  volumes:
    - name: nfs-demo
      persistentVolumeClaim:
        claimName: nfs-demo
EOF

4. 性能测试

4.1 测试工具

  • 安装 Opscli 工具
1
curl -sfL https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh | VERSION=latest sh -
  • 测试命令
1
opscli task --filepath  ~/.ops/tasks/get-diskio-byfio.yaml --filename ./testfile --size 10g -i 127.0.0.1

4.2 三种 nfs 挂载方式

  1. Direct 直接挂载到主机目录
1
mount -t nfs x.x.x.x:/x-x/ /data/
  1. 使用 CSI-Driver-NFS 提供 NFS 存储

参考 https://github.com/kubernetes-csi/csi-driver-nfs

  1. 使用 Fluid NFS Runtime 提供 NFS 存储

4.3 测试结果 - 10 GB 数据

  • Random Read Testing (随机读取测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (GiB)
Direct28.0k1139046910
CSI NFS Pod311512.284136810
Fluid NFS Pod28.2k1109305210
  • Random Write Testing (随机写入测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (GiB)
Direct28.6k1129177510
CSI NFS Pod321712.681471810
Fluid NFS Pod29.2k1148967810
  • Sequential Read Testing (顺序读取测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (GiB)
Direct30293792704310
CSI NFS Pod11501447122610
Fluid NFS Pod26063263142810
  • Sequential Write Testing (顺序写入测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (GiB)
Direct30923872648910
CSI NFS Pod11541447094610
Fluid NFS Pod23002883560510
  • Random Read IOPS Testing (随机读取 IOPS 测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (GiB)
Direct10.5k40.024981710
CSI NFS Pod310712.184348410
Fluid NFS Pod920235.928485210
  • Random Write IOPS Testing (随机写入 IOPS 测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (GiB)
Direct14.2k55.618420510
CSI NFS Pod314812.383258910
Fluid NFS Pod12.0k50.620232110

4.4 测试结果 - 1 GB 数据

  • Random Read Testing (随机读取测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct27.2k10696481024
CSI NFS Pod20.3k79.4129011024
Fluid NFS Pod36.1k14172551024
  • Random Write Testing (随机写入测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct27.6k10894891024
CSI NFS Pod28.3k11092751024
Fluid NFS Pod20.5k80.3127591024
  • Sequential Read Testing (顺序读取测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct429153619091024
CSI NFS Pod112514172801024
Fluid NFS Pod466258317571024
  • Sequential Write Testing (顺序写入测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct468958617471024
CSI NFS Pod116114570521024
Fluid NFS Pod380347521541024
  • Random Read IOPS Testing (随机读取 IOPS 测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct15.5k60.7168711024
CSI NFS Pod14.4k56.3181951024
Fluid NFS Pod15.0k58.8174191024
  • Random Write IOPS Testing (随机写入 IOPS 测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct13.1k51.1200201024
CSI NFS Pod15.0k62.4164231024
Fluid NFS Pod13.2k51.5198751024

4.5 测试结果 - 100 MB 数据

好的,我将按照您提供的格式整理全部的测试案例。

  • Rand_Read_Testing (随机读取测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct14.3k55.71794100
CSI NFS Pod28.1k110912100
Fluid NFS Pod37.0k145691100
  • Rand_Write_Testing (随机写入测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct26.5k104966100
CSI NFS Pod29.4k115872100
Fluid NFS Pod905235.42828100
  • Sequ_Read_Testing (顺序读取测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct3603450222100
CSI NFS Pod1568196510100
Fluid NFS Pod6779847118100
  • Sequ_Write_Testing (顺序写入测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct6666833120100
CSI NFS Pod6349794126100
Fluid NFS Pod6451806124100
  • Rand_Read_IOPS_Testing (随机读取 IOPS 测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct15.4k60.01666100
CSI NFS Pod14.6k56.81759100
Fluid NFS Pod15.4k60.21660100
  • Rand_Write_IOPS_Testing (随机写入 IOPS 测试)
测试环境IOPS带宽 (MiB/s)用时 (msec)数据大小 (MiB)
Direct13.5k52.61900100
CSI NFS Pod15.8k61.91616100
Fluid NFS Pod13.2k51.41944100
  • Rand_Read_Latency_Testing (随机读取延迟测试)
测试环境IOPS带宽 (kB/s)用时 (msec)数据大小 (MiB)
Direct496198551594100
CSI NFS Pod579231944159100
Fluid NFS Pod458183355868100
  • Rand_Write_Latency_Testing (随机写入延迟测试)
测试环境IOPS带宽 (kB/s)用时 (msec)数据大小 (MiB)
Direct458183655785100
CSI NFS Pod575230144495100
Fluid NFS Pod444177657651100

4.5 结论

  • Direct

直接挂载 NFS 的方式性能是最好的,但在 Kubernetes 下只能用 HostPath 挂载,不便于使用。

  • CSI NFS Pod

对于小文件的读写能力很好,适合存储代码等场景,但相较于其他方式优势并不明显。

  • Fluid NFS Pod

Fluid Runtime 提供的 NFS 性能与 Direct 直接挂载的方式性能相差不大,原因在于 Fuse Pod 的原理就是挂载 NFS 目录到当前主机目录。