diff --git a/benchmark/radosbench.py b/benchmark/radosbench.py index fc275aa9..cb411eca 100644 --- a/benchmark/radosbench.py +++ b/benchmark/radosbench.py @@ -6,6 +6,7 @@ import time import threading import logging +import re from cluster.ceph import Ceph from benchmark import Benchmark @@ -30,6 +31,7 @@ def __init__(self, cluster, config): self.out_dir = '%s/osd_ra-%08d/op_size-%08d/concurrent_ops-%08d' % (self.archive_dir, int(self.osd_ra), int(self.op_size), int(self.concurrent_ops)) self.pool_profile = config.get('pool_profile', 'default') self.cmd_path = config.get('cmd_path', '/usr/bin/rados') + self.readmode = config.get('readmode', 'seq') def exists(self): if os.path.exists(self.out_dir): @@ -65,7 +67,8 @@ def run(self): self._run('write', '%s/write' % self.run_dir, '%s/write' % self.out_dir) # Run read test unless write_only if self.write_only: return - self._run('seq', '%s/seq' % self.run_dir, '%s/seq' % self.out_dir) + self._run(self.readmode, '%s/%s' % (self.run_dir, self.readmode), '%s/%s' % (self.out_dir, self.readmode)) + def _run(self, mode, run_dir, out_dir): # We'll always drop caches for rados bench @@ -73,7 +76,16 @@ def _run(self, mode, run_dir, out_dir): if self.concurrent_ops: concurrent_ops_str = '--concurrent-ios %s' % self.concurrent_ops - op_size_str = '-b %s' % self.op_size + #determine rados version + rados_version_str = subprocess.check_output(["rados", "-v"]) + m = re.findall("version (\d+)", rados_version_str) + rados_version = int(m[0]) + + if mode in ['write'] or rados_version < 9: + op_size_str = '-b %s' % self.op_size + else: + op_size_str = '' + common.make_remote_dir(run_dir)