# Network Latency effecting reads

**URL:** <https://forums.percona.com/t/network-latency-effecting-reads/7051>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [June 5, 2019, 5:17pm UTC](https://forums.percona.com/t/network-latency-effecting-reads/7051 "2019-06-05T17:17:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cfinnson](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cfinnson](https://forums.percona.com/u/cfinnson)\
**Post date:** [June 5, 2019, 5:17pm UTC](https://forums.percona.com/t/network-latency-effecting-reads/7051/1 "2019-06-05T17:17:13Z")

</div>

Hi,

I’m currently attempting to configure Percona Cluster over WAN. I’m running into the problem though where reads seem to be slowed down because of the increased network latency. If writes take a bit longer that isn’t too big of a deal for me but the longer reads are a killer.  
The reads aren’t always slow. I would say about 50% of the time it is no different than if the servers were connected only over the LAN. Other times though it takes way longer.  
Every guide that I have seen has said that reads will not be effected by the increased network latency so I’m not really sure what is going on.

To test this I have 3 servers in a cluster. 2 are on a LAN together, and 1 is across the WAN. On average there’s about a 2ms ping.  
The tables that I’m reading from in my tests are never being written to. Only ever read from.  
My test script does 200 separate selects of the same data from that table every time. Usually it takes around 0.15s to do this. On WAN I have seen it reach 5s.  
I have a separate gmcast.segment assigned to the LAN side and the WAN side.

The servers are running CentOS 6. Our percona version is: 5.6.43-84.3-56-log Percona XtraDB Cluster  
WSREP: version 28.32

Here is my my.cnf:

#############################

# GENERAL MYSQL

#############################  
[client]  
port=3306  
socket=/var/lib/mysql/mysql.sock  
[safe\_mysqld]  
port=3306  
socket=/var/lib/mysql/mysql.sock  
log\_error=/var/log/mysql/mysql\_error.log  
[mysql]  
port=3306  
socket=/var/lib/mysql/mysql.sock

#############################

# DIRECTORY

#############################  
[mysqld]  
datadir=/var/lib/mysql  
user=mysql  
log\_error=/var/log/mysql/mysql\_error.log  
general\_log\_file=/var/log/mysql/mysql.log  
general\_log=0  
innodb\_buffer\_pool\_size=1GB  
thread\_handling=pool-of-threads  
max\_connections=1024  
max\_allowed\_packet=16M  
innodb\_log\_file\_size=256M

#############################

# MASTER SETTINGS

#############################  
server\_id=1  
log\_bin=percona-bin  
log\_slave\_updates  
enforce\_gtid\_consistency=1  
gtid\_mode=on

#############################

# CLUSTER CONNECTION URL

#############################  
wsrep\_cluster\_address=gcomm://172.18.1.101,172.18.1.102,192.168.1.101

#############################

# CLUSTER NAME

#############################  
wsrep\_cluster\_name=devcluster

#############################

# GENERAL PERCONA SETTINGS

#############################  
wsrep\_provider=/usr/lib64/libgalera\_smm.so  
binlog\_format=ROW  
default\_storage\_engine=InnoDB  
innodb\_autoinc\_lock\_mode=2  
wsrep\_sst\_method=xtrabackup-v2  
max\_binlog\_files=8  
max\_binlog\_size=1G

#############################

# WAN SETTINGS

#############################

wsrep\_provider\_options=“gmcast.segment=0; gcs.max\_packet\_size=1048576; evs.send\_window=512; evs.user\_send\_window=256; gcs.fc\_limit=128; gcache.size=2G”  
wsrep\_slave\_threads=16  
binlog\_row\_event\_max\_size=2M  
binlog\_cache\_size=2M

#############################

# IP OF THE LOCAL SERVER

#############################  
wsrep\_node\_name=dev-db1  
wsrep\_node\_address=172.18.1.101

#############################

# CLUSTER REPLICATION USERNAME AND PASSWORD

#############################  
wsrep\_sst\_auth=“sstuser:\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*”

Any ideas would be greatly appreciated.

Thank you
