From 802290d686ecfdab4bbd452831f7a84cd516289b Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Wed, 25 Jun 2014 21:20:45 +0100 Subject: [PATCH] osd: OSD: better explanation on 'max_count' calculation for 'osd bench' 'max_count' is the maximum number of bytes that we are to allow for an 'osd bench' command. This value is a hard-cap that takes into account a predefined throughput, the 'osd bench' duration and, for a rather large block size, can be taken as the amount of bytes that we would ever be able to write in that period of time. The explanation wasn't appropriate enough, hence this patch, which hopefully will avoid confusion in the future. Signed-off-by: Joao Eduardo Luis --- src/osd/OSD.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 8974d3aa8763c..d3b496f69a6c9 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4527,6 +4527,11 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector& cmd, buffe // However, to avoid the osd from getting hung on this and having // timers being triggered, we are going to limit the count assuming // a configurable throughput and duration. + // NOTE: max_count is the total amount of bytes that we believe we + // will be able to write during 'duration' for the given + // throughput. The block size hardly impacts this unless it's + // way too big. Given we already check how big the block size + // is, it's safe to assume everything will check out. int64_t max_count = g_conf->osd_bench_large_size_max_throughput * duration; if (count > max_count) { -- 2.39.5