14.5.7 Storing InnoDB Undo Logs in Separate Tablespaces 存储InnoDB Undo logs 到单独的表空间

来源:互联网 发布:ta热分析软件 编辑:程序博客网 时间:2024/06/01 10:37
14.5.7 Storing InnoDB Undo Logs in Separate Tablespaces 存储InnoDB Undo logs 到单独的表空间在MySQL 5.6.3,你可以存储InnoDB undo logs 在一个或者多个单独的undo 表空间在system tablespace外面。这种布局不同于默认的配置 ,默认undo log 是system tablespace的一部分。unod log I/O 模式让那些表空间良好的候选移动到SSD 存储,相比让system tablespace 在hard disk 存储上。用户不能drop 创建用于保存InnoDB undo logs 单独的表空间,或者单独的segments 在那些表空间里。因为那些文件处理I/O操作在system 表空间里,我们扩展 系统表空间的定义来包含那些新的文件:Undo logs 也被称为rollback 段:这个功能设计下面的新的或者重命名的配置选项:mysql> show variables like '%innodb_undo_tablespaces%';+-------------------------+-------+| Variable_name           | Value |+-------------------------+-------+| innodb_undo_tablespaces | 0     |+-------------------------+-------+1 row in set (0.00 sec)mysql> show variables like '%innodb_undo_directory%';+-----------------------+-------+| Variable_name         | Value |+-----------------------+-------+| innodb_undo_directory | .     |+-----------------------+-------+1 row in set (0.00 sec)mysql> show variables like '%innodb_rollback_segments%';+--------------------------+-------+| Variable_name            | Value |+--------------------------+-------+| innodb_rollback_segments | 128   |+--------------------------+-------+1 row in set (0.00 sec)mysql> show variables like '%innodb_undo_logs%';+------------------+-------+| Variable_name    | Value |+------------------+-------+| innodb_undo_logs | 128   |+------------------+-------+1 row in set (0.00 sec)因为InnoDB undo log功能设计设置2个非动态的启动变量((innodb_undo_tablespaces and innodb_undo_directory), 这个功能只能在MySQL 初始化一个实例的时候启用使用说明:使用这个功能,按照以下步骤:1.确定一个路径来保存undo logs.你会指定路径作为 innodb_undo_directory option的参数在你的MySQL 配置文件或者启动脚本。对于嵌入式MySQL实例,一个决定路径必须指定mysql> show variables like '%innodb_undo_directory%';+-----------------------+-------+| Variable_name         | Value |+-----------------------+-------+| innodb_undo_directory | .     |+-----------------------+-------+1 row in set (0.00 sec)2.决定一个初始值对于innodb_undo_logs option.你可以以一个相对低的值启动,随着时间的推移和性能影响来增加3. 决定对一个 innodb_undo_tablespaces选项一个非0值,通过 innodb_undo_logs 指定多个undo logs 是被分成在一些单独的表空间(表现为.ibd文件)。mysql> show variables like '%innodb_undo_tablespaces%';+-------------------------+-------+| Variable_name           | Value |+-------------------------+-------+| innodb_undo_tablespaces | 0     |+-------------------------+-------+1 row in set (0.00 sec)这个值是固定的在MySQL 实例生命周期,如果你不确定最优的值, 偏高的估计。4.创建一个新的MySQL 实例,使用值你选择在配置文件或者在你的MySQL 启动脚本。使用一个类似的负载和你生成服务器类似的负载。另外,使用传输表空间功能来复制存在的数据库表到你新配置的MySQL实例。5. 基准I/O密集型负载:6. 定期增加innodb_undo_logs 的值和返回性能测试,查找在你停止体验收益在I/O性能的值性能和可扩展性方面的考虑:保持undo logs 在单独的文件允许MySQL 团队来执行I/O 和内存优化相关的事务数据。比如,因为Undo 数据被写入磁盘,很少使用( 只有在实例恢复的时候),它不需要保存在文件内存缓存里

0 0