]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
tools/rados: Fix rand & seq read bench to use num ops instead of num objs when issuin...
authorAlbert H Chen <hselin.chen@gmail.com>
Sun, 15 Sep 2019 19:40:55 +0000 (19:40 +0000)
committerAlbert H Chen <hselin.chen@gmail.com>
Sun, 15 Sep 2019 19:40:55 +0000 (19:40 +0000)
commitc28a00cfa5a67267243ce0c5a81d88fe1cb613e5
tree6e01f90835475f0089f51bab54bdd1f666971d22
parente487604ad2af483a54e4616aff2f313a266d99d3
tools/rados: Fix rand & seq read bench to use num ops instead of num objs when issuing and tracking outstanding IO

ObjBencher::seq_read_bench() is using "num_objects > data.started" to make sure
we don't issue more reads than what was written during ObjBencher::write_bench().
However, this does not work op_size != object_size as data.started is number of read
ops issued, not number of objects read.
This fix modifies ObjBencher::seq_read_bench() to use "num_ops > data.started" instead.
Where "num_ops" is metadata saved at the end of ObjBencher::write_bench().

ObjBencher::rand_read_bench() is using "rand() % num_objects" for rand_id and
"rand_id / reads_per_object" to generate object name.
This will not work correctly when reads_per_object != 1 (i.e. when op_size != object_size).
For example, if reads_per_object = 100 and num_objects = 2, then all generated
reads will be directed towards the first object, with no read for the second object.
This fix modifies ObjBencher::rand_read_bench() to use "rand() % num_ops" for rand_id instead.
Where "num_ops" is metadata saved at the end of ObjBencher::write_bench().

This patch also modifies ObjBencher::write_bench() to save number of write operations issued
(num_ops above), rather than number of objects written (num_objects). We can always derive
num_objects based on "(num_ops + ops_per_object - 1) / ops_per_object" where "ops_per_object"
is simply object_size / op_size.

Signed-off-by: Albert H Chen <hselin.chen@gmail.com>
src/common/obj_bencher.cc [changed mode: 0644->0755]
src/common/obj_bencher.h