How can I slow down a MySQL dump as to not affect current load on the server?

前端 未结 6 1431
野性不改
野性不改 2020-11-30 18:11

While doing a MySQL dump is easy enough, I have a live dedicated MySQL server that I am wanting to setup replication on. To do this, I need dumps of the databases to import

6条回答
  •  孤独总比滥情好
    2020-11-30 18:29

    1) first you need to see about your MySQL version. use at least 5.7 so it supports mult thread. Old versions use only 1 thread and is not a good idea at the same time using DB and doing mysqldump if you have large database.

    2) Prefer to build your backup not in the same DB disc, because performanace of read/write, or maybe you need RAID 10.

    3) mysqlbackup from MySQL Enterprise is better, but is paid, I dont know if it is an option to you.

    4) Sometimes many tables dont need transaction, so use transaction only on tables you need

    5) Transaction generally is necessary, use InnoDB format to better performanance and not use lock tables.

    6) Some cases is better to do one program, so you can create your transaction only to read your tables without lock anyone, and test with some sleeps, and not to freeze your service.

提交回复
热议问题