I am facing a very strange issue with Mysql.
I have two cloud server and they are in the same region and VPC network so the internal connection speed is quite fast. Both servers are running CentOS 7.6
I performed a simple test using scp
to copy one large file between them and the speed is about 160MB/s.
Then I installed a MySQL 5.7 on one of the server. I imported a database(about 40GB) into it.
The next time when I tried to do a mysqldump
(locally on the db server) I found the speed is very slow. It is about 4~5 MB/s. It took over 30 minutes to complete.
Here is the command I used:
mysqldump -q --master-data=2 --single-transaction -utest -p'xxxxx' -h192.168.1.47 testdb > testdb.sql
192.168.1.47 is the server private IP.
Then I removed "-h192.168.1.47" part and use "localhost" instead, the speed is very fast and it was doing about 20~30MB/s. It only took six minutes to dump the database.
I tried to dump the db over network on my other server and it is also very slow.
My question: Is there any settings or limitation on the Linux side or MySQL setting that may cause this behavior? Below is mysql configure file.
symbolic-links=0
skip-name-resolve
bind-address=192.168.1.47
datadir=/data/mysql
socket=/var/lib/mysql/mysql.sock
table_open_cache=4096
open_files_limit=65535
max_connections=1500
interactive_timeout=3600
wait_timeout=3600
interactive_timeout=3600
innodb_lock_wait_timeout=300
max_allowed_packet=64M
innodb_log_file_size=512M
innodb_log_buffer_size=1M
tmp_table_size=1024M
max_heap_table_size=1024M
innodb_buffer_pool_size=80G
query_cache_type=0
query_cache_size=0
log-bin=/data/mysql/dbmaster
server-id=1
binlog_format=mixed
expire_logs_days=5
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid