Ceph BackoffThrottle分析

本文深入分析了Ceph中的BackoffThrottle机制,特别是在filestore throttle中的应用。详细阐述了相关配置项、初始化过程以及delay值的计算方式,探讨了在不同压力情况下如何动态调整io速度,以减轻系统压力。通过实例比较了默认配置和优化配置下的dynamic throttle效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


本文讨论下Ceph在Jewel中引入的 dynamic throttle:BackoffThrottle;分析后优化Ceph filestore,journal相关的throttle配置;

BackoffThrottle

Jewel引入了dynamic的throttle,就是代码中BackoffThrottle,现在filestore和Journal都是使用它来做throttle的;
class  FileStore
{
     BackoffThrottle throttle_ops, throttle_bytes;
}
 
class  JournalThrottle {
     BackoffThrottle throttle;
}
BackoffThrottle定义和相关参数如下:
/**
  * BackoffThrottle
  *
  * Creates a throttle which gradually induces delays when get() is called
  * based on params low_threshhold, high_threshhold, expected_throughput,
  * high_multiple, and max_multiple.
  *
  * In [0, low_threshhold), we want no delay.
  *
  * In [low_threshhold, high_threshhold), delays should be injected based
  * on a line from 0 at low_threshhold to
  * high_multiple * (1/expected_throughput) at high_threshhold.
  *
  * In [high_threshhold, 1), we want delays injected based on a line from
  * (high_multiple * (1/expected_throughput)) at high_threshhold to
  * (high_multiple * (1/expected_throughput)) +
  * (max_multiple * (1/expected_throughput)) at 1.
  *
  * Let the current throttle ratio (current/max) be r, low_threshhold be l,
  * high_threshhold be h, high_delay (high_multiple / expected_throughput) be e,
  * and max_delay (max_muliple / expected_throughput) be m.
  *
  * delay = 0, r \in [0, l)
  * delay = (r - l) * (e / (h - l)), r \in [l, h)
  * delay = h + (r - h)((m - e)/(1 - h))
  */
class  BackoffThrottle {
     /// see above, values are in [0, 1].
     double  low_threshhold =  0 ;
     double  high_threshhold =  1 ;
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值