Benchmarking the Ceph block device

The tools, rados bench and rados load-gen, which we discussed in the last recipe, are used to benchmark the Ceph cluster pool. In this recipe, we will focus on benchmarking the Ceph block device with the rbd bench-write tool.

Ceph rbd bench-write

The ceph rbd command-line interface provides an option known as bench-write, which is a tool to perform write benchmarking operations on the Ceph Rados Block Device.

How to do it…

To benchmark the Ceph block device, we need to create a block device and map to the Ceph client node:

  1. Create a Ceph block device named block-device1, of size 1G, and map it:
    # rbd create block-device1 --size 10240
    # rbd info --image block-device1
    # rbd map block-device1
    # rbd showmapped
    
    How to do it…
  2. Create a filesystem on the block device and mount it:
    # mkfs.xfs /dev/rbd0
    # mkdir -p /mnt/ceph-block-device1
    # mount /dev/rbd0 /mnt/ceph-block-device1
    # df -h /mnt/ceph-block-device1
    
    How to do it…
  3. To benchmark block-device1 for 5GB of total write length, execute the following command:
    # rbd bench-write block-device1 --io-total 5368709200
    
    How to do it…

As you can see, the rbd bench-write outputs nicely formatted results.

How it works…

The syntax for the rbd bench-write looks like the following:

# rbd bench-write <RBD image name>
  • --io-size: The write size in bytes; the default is 4M
  • --io-threads: The number of threads; the default is 16
  • --io-total: The total bytes to write; the default is 1024M
  • --io-pattern <seq|rand>: This is the write pattern, the default is seq

There's more…

You can use different options with the rbd bench-write tool to adjust the block size, number of threads, and io-pattern.

See also…

  • Chapter 2, Working with Ceph Block Device, where we covered the creation of the Ceph block device in detail.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.132