From: Abhishek Varshney Date: Tue, 26 Apr 2016 08:54:29 +0000 (+0530) Subject: rgw: introduce rgw_list_bucket_min_readahead parameter for bucket listing from rados X-Git-Tag: v11.0.0~136^2~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75d1132976e4a084174d2142e0b37efd082e490b;p=ceph.git rgw: introduce rgw_list_bucket_min_readahead parameter for bucket listing from rados Signed-off-by: Abhishek Varshney --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 786d9e00d8e8..bdb8d88b8fa2 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -1405,6 +1405,8 @@ OPTION(rgw_period_push_interval_max, OPT_DOUBLE, 30) // maximum interval after e OPTION(rgw_swift_versioning_enabled, OPT_BOOL, false) // whether swift object versioning feature is enabled +OPTION(rgw_list_bucket_min_readahead, OPT_INT, 1000) // minimum number of entries to read from rados for bucket listing + OPTION(mutex_perf_counter, OPT_BOOL, false) // enable/disable mutex perf counter OPTION(throttler_perf_counter, OPT_BOOL, true) // enable/disable throttler perf counter diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 47ba96261c17..00c224133fef 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4737,6 +4737,7 @@ int RGWRados::Bucket::List::list_objects(int max, vector *result, int count = 0; bool truncated = true; + int read_ahead = std::max(cct->_conf->rgw_list_bucket_min_readahead,max); result->clear(); @@ -4793,7 +4794,7 @@ int RGWRados::Bucket::List::list_objects(int max, vector *result, ldout(cct, 20) << "setting cur_marker=" << cur_marker.name << "[" << cur_marker.instance << "]" << dendl; } std::map ent_map; - int r = store->cls_bucket_list(bucket, shard_id, cur_marker, cur_prefix, max + 1 - count, params.list_versions, ent_map, + int r = store->cls_bucket_list(bucket, shard_id, cur_marker, cur_prefix, read_ahead + 1 - count, params.list_versions, ent_map, &truncated, &cur_marker); if (r < 0) return r;