【ceph】Messenger的基准测试工具ceph_perf_msgr_server/ceph_perf_msgr_client|性能测试

源码和编译

源码目录:在ceph源码包中:ceph-16.2.5\src\test\msgr

要将ceph-16.2.5\src\下的CMakeList.txt中add_subdirectory(test)前面的#去掉,

if(WITH_TESTS)
 add_subdirectory(test)
endif()

由于CMakeList.txt用了宏开关,所以cmake的时候要加宏。

在ceph目录下:

mkdir build && cd build

生成makefile

cmake -DWITH_TESTS=1 ../CMakeList.txt

编译ceph_perf_msgr_server   和ceph_perf_msgr_client

make ceph_perf_msgr_server   

make ceph_perf_msgr_client

完成后,在ceph/build/bin下生成ceph_perf_msgr_server   和ceph_perf_msgr_client

用法

CEPH_PERF_MSGR
ceph_perf_msgr仅用于做Messenger模块的基准测试,可以帮助您找到Messenger模块中的瓶颈或耗时。就像“ iperf”一样,我们需要首先启动服务器端程序:

server
 

#./ceph_perf_msgr_server 172.16.30.181:10001 1 0

./ceph_perf_msgr_server [bind ip:port] [server worker threads] [thinktime us]

[bind ip:port]: The ip:port pair to bind, client need to specify this pair to connect
[server worker threads]: threads will process incoming messages and reply(matching pg threads)
[thinktime]: sleep time when do dispatching(match fast dispatch logic in OSD.cc)

第一个参数:ip:port对,绑定IP:绑定端口号。

第二个参数:服务端线程数

第三个参数:模拟dispatch调度每个消息的耗时(“思考时间”(think_time)--代码中: usleep(think_time);)。在Giant之后,CEPH_OSD_OP消息(即实际的客户端读/写io请求)将快速分派,而无需排队到Dispatcher,以实现更好的性能。因此,CEPH_OSD_OP消息将进行内联处理,模拟“内联过程”过程将使用“思考时间”。

void MessengerClient::ClientDispatcher::ms_fast_dispatch(Message *m) {
  usleep(think_time);
  m->put();
  std::lock_guard l{thread->lock};
  thread->inflight--;
  thread->cond.notify_all();
}

client

#./ceph_perf_msgr_client  172.16.30.181:10001  1  32  10000  10  4096

第一个参数:服务器ip:port

第二个参数:客户端线程数

第三个参数:并发性(每个客户端线程的最大发送中的消息数

第四个参数:每个客户端线程发起的IO次数

第五个参数:接收消息时客户端线程的“思考时间”,这也用于模拟客户端快速分配过程。

最后一个参数:消息数据的长度

原文:Messenger notes — Ceph Documentation

高级用法 

  • 修改依赖的库

可以使用命令patchelf   修改工具依赖的动态库位置。避免和项目正在使用的库冲突,修改方法见:https://blog.csdn.net/bandaoyu/article/details/113181179

  • 修改依赖的配置文件

修改依赖的配置文件,避免与正在运行的项目共用配置文件造成相互影响

ceph进程搜索配置文件的路径顺序

Ceph相关进程在读取配置时, 遵循以下的查找顺序

  1. $CEPH_CONF环境变量所指定的配置
  2. -c path/path 参数所指定的配置
  3. /etc/ceph/ceph.conf
  4. ~/.ceph/config (HOME目录下.ceph目录的config文件)
  5. ./ceph.conf (当前目录下的ceph.conf)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值