简体   繁体   English

MySQL MyISAM和innoDB内存使用情况

[英]MySQL MyISAM & innoDB Memory Usage

Does anyone know how much memory MyISAM and innoDB use? 有谁知道MyISAM和innoDB使用多少内存? How does their memory usages compare when dealing with small tables vs. when dealing with bigger tables (up to 32 GB)? 处理小表与处理大表(最大32 GB)时,它们的内存使用情况如何比较?

I know innoDB is heavier than MyISAM, but just how much more? 我知道innoDB比MyISAM重,但是还有多少呢?

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks, jb 谢谢,jb

You can't compare them like that. 您无法像那样比较它们。 Or at least, you shouldn't. 至少,您不应该这样做。 Each one uses the memory in a different way. 每个人以不同的方式使用内存。 This is especially true if you're tunning your DB's for performance. 如果您要调整数据库的性能,则尤其如此。

MyISAM has specific buffers for indexes and it uses the OS disk buffer for caching other data. MyISAM具有用于索引的特定缓冲区,它使用OS磁盘缓冲区来缓存其他数据。 It doesn't make sense to have your buffers larger than the sum of your indexes, but the more memory you give it, the faster it will be. 使缓冲区大于索引的总和是没有意义的,但是给它的内存越多,它的速度就越快。

InnoDB has a buffer pool for all data. InnoDB有一个用于所有数据的缓冲池。 You configure this based on your available memory and how much you want to give it. 您可以根据可用内存以及要分配的内存量来配置它。 InnoDB buffers as much of your data in memory as possible. InnoDB会在内存中尽可能多地缓冲数据。 If you can fit the entire DB in memory, InnoDB will never read from disk. 如果您可以将整个数据库装入内存,InnoDB将永远不会从磁盘读取数据。 A lot of InnoDB databases see huge performance hits when the data size becomes larger than the buffer pool. 当数据大小变得大于缓冲池时,许多InnoDB数据库都会看到巨大的性能下降。

MySQL is very configurable. MySQL是非常可配置的。 It's tunable to meet your needs. 可以满足您的需求。 Typically, databases should be given as much memory as possible since they are almost always disk bound. 通常,应该为数据库提供尽可能多的内存,因为它们几乎总是与磁盘绑定的。 More memory means more can be buffered. 更多的内存意味着可以缓冲更多的内存。

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

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