1

My cronjob consumes 100% cpu even using ionice. Did I do something wrong?

for db in ${databases}; do
  ionice -c 3 nice -19 mysqldump -h localhost...
  wait
done

PS. Amazon Linux

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
Claytinho
  • 513
  • 1
  • 4
  • 6

1 Answers1

2

You are setting nice and ionice priorities for mysqldump process which does not really consumes much, it only sends commands to mysqld process. You should lower priorities for mysqld or (much harder but much better way) setup a Mysql-slave server and make backups from it.

Andrei Mikhaltsov
  • 3,027
  • 1
  • 23
  • 31