Skip to content

Commit

Permalink
radosbench check version, not use -b on newer rados
Browse files Browse the repository at this point in the history
radosbench support new config option readmode
Addresses issues ceph#79, ceph#80

Signed-off-by: Tom Deneau <[email protected]>
  • Loading branch information
criptik committed Feb 10, 2016
1 parent abedf37 commit 7750232
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions benchmark/radosbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import time
import threading
import logging
import re

from cluster.ceph import Ceph
from benchmark import Benchmark
Expand All @@ -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):
Expand Down Expand Up @@ -65,15 +67,25 @@ 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
self.dropcaches()

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)

Expand Down

0 comments on commit 7750232

Please sign in to comment.