InnoDB inserts very slow and slowing down

前端 未结 2 1002
逝去的感伤
逝去的感伤 2020-12-31 13:03

I have recently switched my project tables to InnoDB (thinking the relations would be a nice thing to have). I\'m using a PHP script to index about 500 products at a time. <

2条回答
  •  自闭症患者
    2020-12-31 13:56

    I had a similar problem and it seems InnoDB has by default innodb_flush_log_at_trx_commit enabled which flushes every insert/update query on your hdd log file. The writing speed of your hard disk is a bottleneck for this process.

    So try to modify your mysql config file

      `innodb_flush_log_at_trx_commit  = 0`
    

    Restart mysql service.

    I experienced about x100 speedup on inserts.

提交回复
热议问题