From e38feed966070142e1fd5d3033c9e999a9ffe83c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 16 Dec 2013 18:04:57 +0100 Subject: [PATCH] BUG/MINOR: stats: correctly report throttle rate of low weight servers The throttling of low weight servers (<16) could mistakenly be reported as > 100% due to a rounding that was performed before a multiply by 100 instead of after. This was introduced in 1.5-dev20 when fixing a previous reporting issue by commit d32c399 (MINOR: stats: report correct throttling percentage for servers in slowstart). It should be backported if the patch above is backported. --- include/proto/server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/proto/server.h b/include/proto/server.h index 9cb814470..93f4f81a6 100644 --- a/include/proto/server.h +++ b/include/proto/server.h @@ -75,7 +75,7 @@ static inline unsigned int server_throttle_rate(struct server *sv) if (!sv->uweight) return 100; - return 100U * (px->lbprm.wmult * sv->eweight + px->lbprm.wdiv - 1) / (px->lbprm.wdiv * sv->uweight); + return (100U * px->lbprm.wmult * sv->eweight + px->lbprm.wdiv - 1) / (px->lbprm.wdiv * sv->uweight); } /*