作者:洪斌
爱可生南区负责人兼技术服务总监,MySQL ACE,擅长数据库架构规划、故障诊断、性能优化分析,实践经验丰富,帮助各行业客户解决 MySQL 技术问题,为金融、运营商、互联网等行业客户提供 MySQL 整体解决方案。
本文来源:转载自公众号-玩转MySQL
*爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。
MySQL 默认是启用 innodb_use_native_aio,使用异步 IO 操作,MySQL 启动时所需 aio slot 若超过系统当前 fs.aio-max-nr 设置,则无法启动报错 InnoDB: io_setup() failed with EAGAIN after 5 attempts.
通常在单机单实例环境下很少会遇到超出 aio-max-nr 的问题,若部署单机多实例,会大概率遇到此问题。我们来分析下该如何配置 fs.aio-max-nr 参数。关于 aio-nr 与 aio-max-nr
aio-nr is the running total of the number of events specified on the
io_setup system call for all currently active aio contexts. If aio-nr
reaches aio-max-nr then io_setup will fail with EAGAIN. Note that
raising aio-max-nr does not result in the pre-allocation or re-sizing
of any kernel data structures.
启动 MySQL 时会分配多少个 event slo