diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2019-06-19 15:11:59 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2019-06-20 12:30:59 +0000 |
commit | 2e11f61029d0b36893c4aa859f99c22b6202ad12 (patch) | |
tree | 632750b74d48b29d7ebf644886603467279eeb12 /xlators/cluster/afr/src/afr.c | |
parent | bcdb77023e2efbbf06ad576851f0f38a0b8b11ab (diff) |
afr/read: Implement latency based read child selection
Network latency is an important factor selecting a read subvolume.
So this patch is adding two new policy.
1) We measure the latency of a child during a GF_DUMP rpc call.
Then use this latency to pick a read subvol having the least
latency.
2) Second one is an hybrid mode where it calculates the effective
latency by multiplying outstanding pending read request and
latency, and choose the least one.
Change-Id: Ia49c8a08ab61f7dcdad8b8950aa4d338e7accf97
fixes: #520
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 67ff3409bb9..33a25cc5c0c 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -790,7 +790,7 @@ struct volume_options options[] = { {.key = {"read-hash-mode"}, .type = GF_OPTION_TYPE_INT, .min = 0, - .max = 3, + .max = 5, .default_value = "1", .op_version = {2}, .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE | OPT_FLAG_DOC, @@ -803,7 +803,10 @@ struct volume_options options[] = { "1 = hash by GFID of file (all clients use " "same subvolume).\n" "2 = hash by GFID of file and client PID.\n" - "3 = brick having the least outstanding read requests."}, + "3 = brick having the least outstanding read requests.\n" + "4 = brick having the least network ping latency.\n" + "5 = Hybrid mode between 3 and 4, ie least value among " + "network-latency multiplied by outstanding-read-requests."}, { .key = {"choose-local"}, .type = GF_OPTION_TYPE_BOOL, |