int concurrentios,
uint64_t op_size, uint64_t object_size,
unsigned max_objects,
- bool cleanup, const std::string& run_name, bool no_verify) {
+ bool cleanup, bool hints,
+ const std::string& run_name, bool no_verify) {
if (concurrentios <= 0)
return -EINVAL;
char* contentsChars = new char[op_size];
lock.Lock();
data.done = false;
+ data.hints = hints;
data.object_size = object_size;
data.op_size = op_size;
data.in_flight = 0;
bool done; //is the benchmark is done
uint64_t object_size; //the size of the objects
uint64_t op_size; // the size of the read/write ops
+ bool hints;
// same as object_size for write tests
int in_flight; //number of reads/writes being waited on
int started;
int aio_bench(
int operation, int secondsToRun,
int concurrentios, uint64_t op_size, uint64_t object_size, unsigned max_objects,
- bool cleanup, const std::string& run_name, bool no_verify=false);
+ bool cleanup, bool hints, const std::string& run_name, bool no_verify=false);
int clean_up(const std::string& prefix, int concurrentios, const std::string& run_name);
void set_show_time(bool dt) {
" rollback <obj-name> <snap-name> roll back object to snap <snap-name>\n"
"\n"
" listsnaps <obj-name> list the snapshots of this object\n"
-" bench <seconds> write|seq|rand [-t concurrent_operations] [--no-cleanup] [--run-name run_name]\n"
+" bench <seconds> write|seq|rand [-t concurrent_operations] [--no-cleanup] [--run-name run_name] [--no-hints]\n"
" default is 16 concurrent IOs and 4 MB ops\n"
" default is to clean up after write benchmark\n"
" default run-name is 'benchmark_last_metadata'\n"
librados::ObjectWriteOperation op;
if (write_destination & OP_WRITE_DEST_OBJ) {
+ if (data.hints)
+ op.set_alloc_hint2(data.object_size, data.op_size,
+ ALLOC_HINT_FLAG_SEQUENTIAL_WRITE |
+ ALLOC_HINT_FLAG_SEQUENTIAL_READ |
+ ALLOC_HINT_FLAG_APPEND_ONLY |
+ ALLOC_HINT_FLAG_IMMUTABLE);
op.write(offset, bl);
}
bool block_size_specified = false;
int bench_write_dest = 0;
bool cleanup = true;
+ bool hints = true; // for rados bench
bool no_verify = false;
bool use_striper = false;
bool with_clones = false;
if (i != opts.end()) {
cleanup = false;
}
+ i = opts.find("no-hints");
+ if (i != opts.end()) {
+ hints = false;
+ }
i = opts.find("pretty-format");
if (i != opts.end()) {
pretty_format = true;
object_size = op_size;
else if (object_size < op_size)
op_size = object_size;
+ cout << "hints = " << (int)hints << std::endl;
ret = bencher.aio_bench(operation, seconds,
concurrent_ios, op_size, object_size,
- max_objects, cleanup, run_name, no_verify);
+ max_objects, cleanup, hints, run_name, no_verify);
if (ret != 0)
cerr << "error during benchmark: " << ret << std::endl;
if (formatter && output)
opts["show-time"] = "true";
} else if (ceph_argparse_flag(args, i, "--no-cleanup", (char*)NULL)) {
opts["no-cleanup"] = "true";
+ } else if (ceph_argparse_flag(args, i, "--no-hints", (char*)NULL)) {
+ opts["no-hints"] = "true";
} else if (ceph_argparse_flag(args, i, "--no-verify", (char*)NULL)) {
opts["no-verify"] = "true";
} else if (ceph_argparse_witharg(args, i, &val, "--run-name", (char*)NULL)) {