Ceph: validate that the RBD cache is active

Quick and simple test to validate if the RBD cache is enabled on your client.

Simple thing first, if you are running a Ceph version newer or equal than 0.87 the cache is enabled by default. If not then you can simply enable the cache via the [client]:

[client]
rbd cache = true
rbd cache writethrough until flush = true

Then you need to activate two flags in your ceph.conf within the [client]:

[client]
admin socket = /var/run/ceph/$cluster-$type.$id.$pid.$cctid.asok
log file = /var/log/ceph/

Both paths must be writable by the user running using the RBD library and the security context (SELinux or AppArmor) must be configured properly.

Once this is done, run your application that is supposed to use librbd (a virtual machine or something else) and simply request the admin daemon from a socket:

$ sudo ceph --admin-daemon /var/run/ceph/ceph-client.admin.66606.140190886662256.asok config show | grep rbd_cache
"rbd_cache": "true",
"rbd_cache_writethrough_until_flush": "true",
"rbd_cache_size": "33554432",
"rbd_cache_max_dirty": "25165824",
"rbd_cache_target_dirty": "16777216",
"rbd_cache_max_dirty_age": "1",
"rbd_cache_max_dirty_object": "0",
"rbd_cache_block_writes_upfront": "false",

Verify the cache behaviour

If you want to go further and test the performance enhancement brought by the cache you can do the following turn it off from the [client] section in your ceph.conf like this rbd cache = false. Then a benchmark like so using the following command (assuming the RBD pool exists):

$ rbd -p rbd bench-write fio —io-size 4096 —io-threads 256 —io-total 1024000000 —io-pattern seq

Eventually run this test with and without the cache section should bring a significant difference :).

Ceph: validate that the RBD cache is active的更多相关文章

  1. rbd cache (一)

    cache 1.why The existence of cache is based on a mismatch between the performance characteristics of ...

  2. Tier和RBD Cache的区别

    相同点 缓存 数据不会持久保存在ssd或者内存:预读回写直写 都需要解决缓存数据和磁盘数据不一致和“内存页”置换的问题. 差异点 缓存的位置不同,tier是rados层在osd端进行数据缓存,也就是说 ...

  3. 删除 Ceph 的image报rbd: error: image still has watchers

    在Ceph集群日常运维中,管理员可能会遇到有的image删除不了的情况,有一种情况是由于image下有快照信息,只需要先将快照信息清除,然后再删除该image即可,还有一种情况是因为该image仍旧被 ...

  4. ceph中查看一个rbd的image的真实存储位置

    1.新建一个image存储 rbd create hzb-mysql --size 2048 2.查看hzb-mysql的所有对象 一个rbd image实际上包含了多个对象(默认情况下是image_ ...

  5. 从ceph对象中提取RBD中的指定文件

    前言 之前有个想法,是不是有办法找到rbd中的文件与对象的关系,想了很久但是一直觉得文件系统比较复杂,在fs 层的东西对ceph来说是透明的,并且对象大小是4M,而文件很小,可能在fs层进行了合并,应 ...

  6. 理解 QEMU/KVM 和 Ceph(2):QEMU 的 RBD 块驱动(block driver)

    本系列文章会总结 QEMU/KVM 和 Ceph 之间的整合: (1)QEMU-KVM 和 Ceph RBD 的 缓存机制总结 (2)QEMU 的 RBD 块驱动(block driver) (3)存 ...

  7. ceph cache pool配置

    https://my.oschina.net/hanhanztj/blog/515410 0.引入 本文介绍如何配置cache pool tiering. cache pool的作用是提供可扩展的ca ...

  8. Ceph块设备

    Ceph块设备 来自这里. 块是一个字节序列(例如,一个512字节的数据块).基于块的存储接口是最常见的存储数据的方法,它通常基于旋转介质,像硬盘.CD.软盘,甚至传统的9道磁带. 基本的块设备命令 ...

  9. 理解 QEMU/KVM 和 Ceph(1):QEMU-KVM 和 Ceph RBD 的 缓存机制总结

    本系列文章会总结 QEMU/KVM 和 Ceph 之间的整合: (1)QEMU-KVM 和 Ceph RBD 的 缓存机制总结 (2)QEMU 的 RBD 块驱动(block driver) (3)存 ...

随机推荐

  1. url 特殊字符

    URL中的特殊字符 有些符号在URL中是不能直接传递的,如果要在URL中传递这些特殊符号,那么就要使用他们的编码了.编码的格式为:%加字符的ASCII码,即一个百分号%,后面跟对应字符的ASCII(1 ...

  2. POJ3255Roadblocks[次短路]

    Roadblocks Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 12697   Accepted: 4491 Descr ...

  3. tiny6410在I2c用户态中的程序设计eeprom

    在读写的过程中,发现写数据成功但是读取数据却失败,猜测是因为iic的读写操作过快,故在写操作后给一定的延迟,进而读写成功. 代码如下: #include <stdio.h>#include ...

  4. Apache 的搭建及vim的简单命令

    一. vim 简单命令 pwd     当前路径 ls    当前路径所有目录 cd  目录地址   跳转到指定目录 /xxx  查找xxx x 删除当前字符 n 执行上一次查找 二.为什么使用apa ...

  5. MysqlHelper 需要重写

    using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Text;u ...

  6. 改变input默认选中颜色

    修改 outline-color 属性即可实现

  7. 在VisualStudio2013,2015中如何安装自定义项目模板

    For example, I want to install EP prj template: AxWebProject.zip Copy AxWebProject.zip zip file into ...

  8. ONS C++ Windows SDK 调试方法及注意事项

    此文将展示ONS C++ Windows SDK 整个调试过程,笔者直接使用sdk包中的example消息发送示例代码,开发环境为win7, 64位,Visual Studio Professiona ...

  9. Java Web开发Tomcat中三种部署项目的方法

    第一种方法:在tomcat中的conf目录中,在server.xml中的,<host/>节点中添加: <Context path="/hello" docBase ...

  10. opencv6.2-imgproc图像处理模块之图像尺寸上的操作及阈值

    接opencv6.1-imgproc图像处理模块之平滑和形态学操作,顺带说一句在opencv中的in-place操作就是比如函数的输入图像和输出图像两个指针是相同的,那么就是in-place操作了.比 ...