+-------------------+------------+
| Variable_name | Value |
+-------------------+------------+
| Key_read_requests | 3916880184 |
| Key_reads | 1014261 |
+-------------------+------------+
2 rows in set (0.00 sec) 3916880184/1024/1024=?M //单位为兆
引用
“The number of open tables for all threads. Increasing this value increases the number of file descriptors that mysqld requires.
Therefore you have to make sure to set the amount of open files allowed to at least 4096 in the variable "open-files-limit" in” section [mysqld_safe]”
说的就是要注意这个问题,一想到这里,部分兄弟可能会用ulimit -n 作出调整,但是这个调整实际是不对的,换个终端后,这个值又会回到原始值,所以最好用sysctl或者修改/etc/sysctl.conf文件,同时还要在配置文件中把open_files_limit这个参数增大,对于4G内存服务器,相信现在购买的服务器都差不多用4G的了,那这个这个open_files_limit至少要增大到4096,如果没有什么特殊情况,设置成8192就可以了。 innodb_buffer_pool_size 这个参数和MyISAM的key_buffer_size有相似之处,但也是有差别的。这个参数主要缓存innodb表的索引,数据,插入数据时的缓冲。为Innodb加速优化首要参数。 该参数分配内存的原则:这个参数默认分配只有8M,可以说是非常小的一个值。如果是一个专用DB服务器,那么他可以占到内存的70%-80%。这个参数不能动态更改,所以分配需多考虑。分配过大,会使Swap占用过多,致使Mysql的查询特慢。如果你的数据比较小,那么可分配是你的数据大小+10%左右做为这个参数的值。