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.
This commit is contained in:
Willy Tarreau 2013-12-16 18:04:57 +01:00
parent b169eba58d
commit e38feed966

View File

@ -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);
}
/*