We've observed significant imbalance in gc queue loading, most
likely due to poor ceph_str_hash_linux dispersion for common
key forms.
XXHash64 should be an effective and fast replacement for all
current RGW users of ceph_str_hash_linux (which also include
bucket-index sharding and bucket-lifecycle shard selection).
Unlike the other users, gc queue selection appears safe to
"just switch" as only defer-gc operations (which are non-critical
and of brief temporal locality) make any sort of rendezvous
on specific enqueued tags.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
#include <list> // XXX
#include <sstream>
+#include "xxhash.h"
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
int RGWGC::tag_index(const string& tag)
{
- return rgw_shard_id(tag, max_objs);
+ return rgw_shards_mod(XXH64(tag.c_str(), tag.size(), seed), max_objs);
}
int RGWGC::send_chain(cls_rgw_obj_chain& chain, const string& tag)
string *obj_names;
std::atomic<bool> down_flag = { false };
+ static constexpr uint64_t seed = 8675309;
+
int tag_index(const string& tag);
class GCWorker : public Thread {