Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are doing offsite mysql replication over long distance and limited bandwidth - latency of about 200ms and about 70KB/s (max).

The replication works sporadically, transferring several tens of kilobytes and then reconnecting.

I have traced the problem to bad tcp/ip behavior of the mysqld daemon on the client - when a single tcp/ip packet is lost, the whole ACK/retransmit sequence can not recover the connection and at some point server issues FIN.

It is notable that scp from the same server works properly (even with packets lost that happens occasionally).

Mysql client from the client machine to the server also works properly and occasional packet loss does not break the connection.

Both server and client have the same version of mysql server:

mysql> SHOW VARIABLES LIKE '%version%';
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| protocol_version        | 10                  | 
| version                 | 5.0.67-0ubuntu6-log | 
| version_comment         | (Ubuntu)            | 
| version_compile_machine | x86_64              | 
| version_compile_os      | debian-linux-gnu    | 
+-------------------------+---------------------+
5rows in set (0.21 sec)

Might this caused by packets loss that happens when TCP/IP attempts to raise TCP/IP window beyond what is allowed by the connection?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I ended up with using ssh tunnel (and adjusting replication settings a bit) - works perfectly:

ssh -L 3307:localhost:3307 root@the-replication-master-server

Added bonus is that the replication stream is encrypted.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.