ceph.rados.rados_bench module
RADOS bench testing uses the rados binary that comes with the ceph-common package. It contains a benchmarking facility that exercises the cluster by way of librados, the low level native object storage API provided by Ceph.
- exception ceph.rados.rados_bench.ClientLookupFailure
Bases:
Exception
- exception ceph.rados.rados_bench.ClientNotFoundError
Bases:
Exception
- exception ceph.rados.rados_bench.PoolNotFoundError
Bases:
Exception
- class ceph.rados.rados_bench.RadosBench(mon_node, clients=[])
Bases:
objectRados Bench class to execute benchmark tests
- static cleanup(client, pool_name, run_name='')
clean up benchmark operation
- Parameters
client (CephNode) – client node to execute rados bench
pool_name (Str) – osd pool name
run_name (Str) – Rados benchmark run-name(Optional)
Example:
rados cleanup -p test_bench --run-name test1
- continuous_run(client, pool_name, duration)
- run indefinite loop of rados bench IOs with data provided
write
sequential read
cleanup
- Parameters
client (CephNode) – client node to execute rados benchmark commands
pool_name (Str) – ceph OSD pool name
duration (Int) – duration of benchmark run in seconds
- fetch_client(node='')
Returns node if node name provided else self.clients[0]
- Parameters
node (Str) – node name
- Returns
node (CephNode)
- initiate_stop_signal()
- run(config)
Execute benchmark
Create necessary pools
Initiate executor
Submit thread
return
- Parameters
config (dict) – benchmark execution config
Example:
config: duration (int): benchmark duration pg_num (int): placement group number pool_per_client (bool): True - pool per client, False - one pool used by all clients
- static sequential_read(client, pool_name, **config)
Rados bench sequential read test for provided time duration
- Parameters
config (dict) – sequential read ops command arguments
client (CephVMNode) – client node
pool_name (str) – osd pool name
- Returns
run_name (str)
Example:
rados bench 10 seq -p test_bench 10 seq --run-name test2 config: seconds: duration of write ops (Default:10) run-name: benchmark run-name created based on (Boolean value : Optional) no-cleanup: no clean-up option (Boolean value, Default: false(clean-up)) no-hints: no-hint option (Boolean value, Default: false(hints)) concurrent-ios: integer (String value) reuse-bench: bench name (String value)
- Warning
there should be a write operation pre-executed.
- stop_signal()
- teardown()
cleanup bench mark residues - remove pools - wait for tasks completion with cleanup
- wait_for_completion()
Wait for all tasks completion
- static write(client, pool_name, **config)
Rados bench write test for provided time duration
- Parameters
client (CephVMNode) – client node
pool_name (Str) – osd pool name
config (Dict) – write ops command arguments
- Returns
run_name (Str)
Example:
rados bench 10 write -p test_bench --no-cleanup --run-name test2 config: seconds (Int) : duration of write ops (Default:10) run-name (Str) : benchmark run-name created based on (Optional) no-cleanup (Bool) : no clean-up option (Default: false (clean-up)) no-hints (Bool) : no-hint option (Default: false(hints)) concurrent-ios (Str) : integer (String value) reuse-bench (Str) : bench name (String value)
- exception ceph.rados.rados_bench.RadosBenchExecutionFailure
Bases:
Exception
- ceph.rados.rados_bench.create_id(prefix='')
Return unique name with prefix
- Parameters
prefix (Str) – required prefix
- Returns
Unique Id (Str)
- ceph.rados.rados_bench.create_osd_pool(node, pool_name=None, pg_num=16)
Create OSD pool
- Parameters
node (CephNode) – node with Ceph CLI accessibility
pool_name (Str) – pool name # preferred pool name else self.create_id()
pg_num (Int) – placement group number
- Returns
pool name (Str)