MXS-1777 Remove selection of servers with historically lower number of connections.
Removed the almost equal comparison and subsequent selection based on historical number of connections. The effect of it was this: Select the server that has historically, weights or not, been slower. Tested this with 2.2 with maxscale on one server and mariadb:s on two servers with different network lags. The tests with historical selects were clearly slower.
This commit is contained in:
@ -21,18 +21,7 @@
|
||||
|
||||
namespace maxscale
|
||||
{
|
||||
|
||||
bool server_set_status(SERVER* server, int bit, std::string* errmsg_out = NULL);
|
||||
bool server_clear_status(SERVER* server, int bit, std::string* errmsg_out = NULL);
|
||||
|
||||
/** Returns true if the two server "scores" are within 1/(see code) of each other.
|
||||
* The epsilon needs tweaking, and might even need to be in config. This
|
||||
* function is important for some compares, where one server might be only
|
||||
* marginally better than others, in which case historical data could determine
|
||||
* the outcome.
|
||||
*/
|
||||
inline bool almost_equal_server_scores(double lhs, double rhs)
|
||||
{
|
||||
constexpr double div = 100; // within 1% of each other.
|
||||
return std::abs((long)(lhs - rhs)) < std::abs((long)std::max(lhs, rhs)) * (1 / div);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user