summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorSimon Rettberg2021-03-26 13:44:47 +0100
committerSimon Rettberg2021-03-26 13:44:47 +0100
commit3a7891e26aec9e5d15d21a78cb317926d96f51e9 (patch)
tree9c221489ad96ca3f6d7207a4b1c171ef0554b294 /inc
parent[KERNEL] Use sockaddr instead of dnbd3_host_t where possible (diff)
downloaddnbd3-3a7891e26aec9e5d15d21a78cb317926d96f51e9.tar.gz
dnbd3-3a7891e26aec9e5d15d21a78cb317926d96f51e9.tar.xz
dnbd3-3a7891e26aec9e5d15d21a78cb317926d96f51e9.zip
[KERNEL] Implement best_count logic for load balancing
Similar logic already exists in the fuse client: Count how many times in a row a server was fastest when measuring RTTs, and lower the switching threshold more the higher the count gets.
Diffstat (limited to 'inc')
-rw-r--r--inc/dnbd3/config/client.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/dnbd3/config/client.h b/inc/dnbd3/config/client.h
index f35f673..49d4676 100644
--- a/inc/dnbd3/config/client.h
+++ b/inc/dnbd3/config/client.h
@@ -8,7 +8,7 @@
#define SOCKET_TIMEOUT_CLIENT_DATA 2
#define SOCKET_TIMEOUT_CLIENT_DISCOVERY 1
-#define RTT_THRESHOLD_FACTOR(us) (((us) * 2) / 3) // 2/3 = current to best must be 33% worse
+#define RTT_THRESHOLD_FACTOR(us) (((us) * 3) / 4) // 3/4 = current to best must be 25% worse
#define RTT_ABSOLUTE_THRESHOLD (80000) // Or 80ms worse
#define RTT_UNREACHABLE 0x7FFFFFFul // Use this value for timeout/unreachable as RTT. Don't set too high or you might get overflows. 0x7FFFFFF = 134 seconds
// This must be a power of two: