# pt-table-sync over bad connections

**URL:** <https://forums.percona.com/t/pt-table-sync-over-bad-connections/2709>\
**Category:** Percona Toolkit\
**Created:** [May 23, 2013, 11:58pm UTC](https://forums.percona.com/t/pt-table-sync-over-bad-connections/2709 "2013-05-23T23:58:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ict.projects](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@ict.projects](https://forums.percona.com/u/ict.projects)\
**Post date:** [May 23, 2013, 11:58pm UTC](https://forums.percona.com/t/pt-table-sync-over-bad-connections/2709/1 "2013-05-23T23:58:17Z")

</div>

Dear All,  
I’m working for an NGO in Nepal (INF [www.inf.org](http://www.inf.org)) and we are using pt-table-sync to synchronize a MySQL database across our centers in different parts of the country. We do not need live syncing, once a day is enough.  
So I wrote a wrapper around pt-table-sync that runs on the main server and syncs (bidirectional) table by table on all the servers in the small offices around the country. We are using VPN to connect to every office.  
It works fine as long the Internet connection is OK. But here in Nepal we are suffering often from bad internet connections. So 10-25% packet loss is nothing unusual. And then we run into problems like “DBD::mysql::db commit failed: Lost connection to MySQL server during query at /usr/bin/pt-table-sync line 10925”

Could somebody give me advise how to tune pt-table-sync and the MySQL server so the connection becomes more robust and could cope with more packet loss?

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [May 24, 2013, 8:12am UTC](https://forums.percona.com/t/pt-table-sync-over-bad-connections/2709/2 "2013-05-24T08:12:36Z")

</div>

You may be interested in this article:  
[url][http://www.mysqlperformanceblog.com/2007/07/08/mysql-net\_write\_timeout-vs-wait\_timeout-and-protocol-notes/[/url]](http://www.mysqlperformanceblog.com/2007/07/08/mysql-net_write_timeout-vs-wait_timeout-and-protocol-notes/%5B/url%5D)  
In short, you may need to increase net\_read\_timeout and net\_write\_timeout.

Btw, why do you need so regular pt-table-sync? Isn’t MySQL replication doing what is supposed to do?
