搜索

12.7. 分析 Crimson

download PDF

分析 Crimson 是利用 Crimson 进行性能测试的方法。支持两种类型的性能分析:

  • 灵活的 I/O (FIO)- crimson-store-nbd 将可配置 FuturizedStore 内部显示为用于 FIO 的 NBD 服务器。
  • Ceph 基准测试工具(CBT)- 在 python 中测试利用,测试 Ceph 集群的性能。

流程

  1. 安装 libnbd 和编译 FIO:

    示例

    [root@host01 ~]# dnf install libnbd
    [root@host01 ~]# git clone git://git.kernel.dk/fio.git
    [root@host01 ~]# cd fio
    [root@host01 ~]# ./configure --enable-libnbd
    [root@host01 ~]# make

  2. build crimson-store-nbd:

    示例

    [root@host01 ~]# cd build
    [root@host01 ~]# ninja crimson-store-nbd

  3. 使用块设备运行 crimson-store-nbd 服务器。指定原始设备的路径,如 /dev/nvme1n1

    示例

    [root@host01 ~]# export disk_img=/tmp/disk.img
    [root@host01 ~]# export unix_socket=/tmp/store_nbd_socket.sock
    [root@host01 ~]# rm -f $disk_img $unix_socket
    [root@host01 ~]# truncate -s 512M $disk_img
    [root@host01 ~]# ./bin/crimson-store-nbd \
      --device-path $disk_img \
      --smp 1 \
      --mkfs true \
      --type transaction_manager \
      --uds-path ${unix_socket} &
     --smp is the CPU cores.
    --mkfs initializes the device first.
    --type is the backend.

  4. 创建名为 nbd.fio 的 FIO 作业:

    示例

    [global]
    ioengine=nbd
    uri=nbd+unix:///?socket=${unix_socket}
    rw=randrw
    time_based
    runtime=120
    group_reporting
    iodepth=1
    size=512M
    
    [job0]
    offset=0

  5. 使用编译的 FIO 测试 Crimson 对象:

    示例

    [root@host01 ~]# ./fio nbd.fio

Ceph 基准工具(CBT)

针对两个分支运行相同的测试。一个是 main(master),另一个是您选择的 主题 分支。比较测试结果。除了每个测试案例外,还会定义一组规则来检查在比较两组测试结果时是否需要执行回归。如果找到可能的回归问题,则会突出显示规则和对应的测试结果。

流程

  1. 在主分支和主题分支中运行 make crimson osd

    示例

    [root@host01 ~]# git checkout master
    [root@host01 ~]# make crimson-osd
    [root@host01 ~]# ../src/script/run-cbt.sh --cbt ~/dev/cbt -a /tmp/baseline ../src/test/crimson/cbt/radosbench_4K_read.yaml
    [root@host01 ~]# git checkout topic
    [root@host01 ~]# make crimson-osd
    [root@host01 ~]# ../src/script/run-cbt.sh --cbt ~/dev/cbt -a /tmp/yap ../src/test/crimson/cbt/radosbench_4K_read.yaml

  2. 比较测试结果:

    示例

    [root@host01 ~]# ~/dev/cbt/compare.py -b /tmp/baseline -a /tmp/yap -v

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.