简体   繁体   English

将MySQL数据库的存储引擎从InnoDB转换为MyISAM并返回(特定于Drupal 7)有什么后果?

[英]What are the consequences of converting the storage engine of a MySQL database from InnoDB to MyISAM and back (Drupal 7 specific)?

I'm in the process of upgrading a medium scale (200k+ users) Drupal 6 CMS to Drupal 7. Data migration will be handled by using the Migrate Module . 我正在将中等规模(200k +用户) Drupal 6 CMS升级到Drupal 7.数据迁移将通过使用迁移模块来处理。 Up to and including Drupal version 6, MyISAM was the default MySQL storage engine for the Drupal database. 直到并包括Drupal版本6,MyISAM是Drupal数据库的默认MySQL存储引擎。 Since Drupal version 7, InnoDB is recommended. 从Drupal版本7开始,推荐使用InnoDB。 According to this, the migration classes I've developed have to migrate data from the old D6 MyISAM DB to the new D7 InnoDB DB. 据此,我开发的迁移类必须将数据从旧的D6 MyISAM DB迁移到新的D7 InnoDB DB。

I'm experiencing serious performance issues when I run the migration scripts: The migration of the 200k+ user profiles would take more than 20 hours on a "large" Amazon Web Services server instance, which has actually been optimized for this purpose. 我在运行迁移脚本时遇到了严重的性能问题:在“大型”Amazon Web Services服务器实例上迁移200k +用户配置文件需要20多个小时,而实际上已针对此目的进行了优化。 Such performance issues are not uncommon for migrations utilizing said migration module, as I've learned from reading the module's issues tracker. 正如我从阅读模块的问题跟踪器中学到的那样,这种性能问题对于使用所述迁移模块的迁移并不罕见。 However, I've found a solution to increase the performance tenfold by converting the D7 DB from InnoDB to MyISAM. 但是,通过将D7 DB从InnoDB转换为MyISAM,我找到了将性能提高十倍的解决方案。

Now here's the question: Since I'll have to run the D7 DB using the InnoDB storage engine once it will be used by the users again, I wonder whether it could mean any harm to the DB if I set the storage engine to MyISAM for the duration of the migration process and afterwards back to InnoDB? 现在问题是:由于我将不得不使用InnoDB存储引擎运行D7数据库,一旦用户再次使用它,我想知道如果我将存储引擎设置为MyISAM,它是否会对数据库造成任何损害迁移过程的持续时间以及之后回到InnoDB?

Thanks for your help. 谢谢你的帮助。

If you're seeing a very large performance difference between InnoDB and MyISAM, it's very likely that the reason is due to transactional guarantees that InnoDB is making. 如果你看到InnoDB和MyISAM之间存在非常大的性能差异,那很可能是因为InnoDB正在进行交易保证。 Setting the innodb_flush_log_at_trx_commit variable to 0 during migration should allow you to achieve very good performance for the time of the migration, and you can then set it back to 1 after migration has completed. 在迁移期间将innodb_flush_log_at_trx_commit变量设置为0应该允许您在迁移时获得非常好的性能,然后可以在迁移完成后将其设置回1

It is safe to change on-the-fly; 即时更换是安全的; however you should note that if the server crashes while it is set to 0 , you may lose some committed transactions (but for your migration I'd guess that caveat is fine). 但是你应该注意,如果服务器在设置为0崩溃,你可能会丢失一些已提交的事务(但是对于你的迁移,我猜这个警告很好)。

you can also change sync_binlog variable to 0 ant it can also increase the speed upto 20% and after migration you can set it back to 1. 你也可以将sync_binlog变量更改为0,它也可以将速度提高到20%,迁移后你可以将它设置为1。

but in between if there would be some power failure in between the process, you might lose some data. 但如果在此过程之间出现电源故障,则可能会丢失一些数据。 but i think you are just migrating the data, then it will not take so much time and chances of power failure are very low. 但我认为你只是在迁移数据,那么它不会花费太多时间,而且电源故障的可能性非常低。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM