MDEV-8669 MTR client connections on Windows became much slower.

The regression is caused by change bind-address server parameter
in MDEV-8083, so now server listens on IPv4 only by default.

The problem however is that on Windows, connection to server on localhost
appears to be much faster, if server listens on IPv6/dual stack.
mysql_real_connect() would try to connect to IPv6 loopback  first,
and if this fails, the failing connect() call takes several seconds.

To fix, use bind-address=* on Windows, and 127.0.0.1 elsewhere
This commit is contained in:
Vladislav Vaintroub 2015-11-03 17:41:06 +01:00
parent fa1438cbf4
commit 245bfc52fc
2 changed files with 8 additions and 1 deletions

View File

@ -31,7 +31,6 @@ debug-no-sync
# Retry bind as this may fail on busy server
port-open-timeout=10
bind-address=127.0.0.1
log-bin-trust-function-creators=1
key_buffer_size= 1M

View File

@ -169,6 +169,13 @@ sub fix_log {
return "$dir/mysqld.log";
}
sub fix_bind_address {
if (IS_WINDOWS) {
return "*";
} else {
return "127.0.0.1";
}
}
sub fix_log_slow_queries {
my ($self, $config, $group_name, $group)= @_;
my $dir= dirname($group->value('datadir'));
@ -251,6 +258,7 @@ my @mysqld_rules=
{ 'ssl-ca' => \&fix_ssl_ca },
{ 'ssl-cert' => \&fix_ssl_server_cert },
{ 'ssl-key' => \&fix_ssl_server_key },
{ 'bind-address' => \&fix_bind_address },
);
if (IS_WINDOWS)