LoginSignup
2
4

More than 5 years have passed since last update.

MySQLでALTER TABLEしたらOut of memoryが出る対応

Posted at

エラー内容

大きなテーブルにALTER TABLEしたらメモリが足りなくて下記のエラーが出る

An error has occurred, all later migrations canceled: Mysql2::Error: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space:

対策

  1. RDSのインスタンスのメモリをあげる
  2. innodb_buffer_pool_sizeを下げる(AWSは{DBInstanceClassMemory*3/4}がデフォルトだが1/2にしても問題なし)
2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4