如何确保 MySQL 正在使用所有可用内存?
愚蠢的问题:我有 4 GB RAM,我的数据集约为 500 MB。如何确保 MySQL/InnoDB 将我的数据集保存在 RAM 中?
Dumb question: I have 4 gb of RAM and my dataset is around 500 mb. How can I make sure MySQL/InnoDB is keeping my dataset in RAM?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
MySQL Tuning Primer 为您提供有关 MySQL 性能的大量信息和建议。请记住(它会警告您),实例应该运行一段时间才能为您提供准确的反馈。
MySQL Tuning Primer gives you lots info and recommendations regarding your MySQL performance. Keep in mind (and it will warn you), the instance should be running for a period of time to give you accurate feedback.
将 innodb_buffer_pool 设置为 3G - InnoDB 将在缓冲池中加载尽可能多的数据。
set the innodb_buffer_pool to 3G - InnoDB will load as much data it can in the buffer pool.
Darhazer 是对的(我会投票给他,但没有代表点)。通常建议将 innodb_buffer_pool_size 设置为内存的 70-80%,尽管它实际上比这更复杂,因为您需要考虑系统其他部分实际使用的 RAM 量。
Darhazer is right (I'd vote him up but don't have the rep points). It's generally recommended to set innodb_buffer_pool_size to 70-80% of memory although it's really more complicated than that since you need to account for how much RAM other parts of your system is actually using.