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

前端 未结 6 1440
野性不改
野性不改 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:30

    You can prefix the mysqldump command with the following:

    ionice -c3 nice -n19 mysqldump ...
    

    Which will run it at low IO and CPU priority so should limit the impact of it.

    Note, this will only delay the time between MySQL executing. The scripts themselves will still be as intensive as they were before, just with a longer break between scripts.

提交回复
热议问题