From 3a7891e26aec9e5d15d21a78cb317926d96f51e9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 26 Mar 2021 13:44:47 +0100 Subject: [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. --- inc/dnbd3/config/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') 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: -- cgit v1.2.3-55-g7522