Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a few small radosbench tweaks #81

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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