你的位置:首页 > 软件开发 > 数据库 > mysql中内存的使用与分配

mysql中内存的使用与分配

发布时间:2015-10-14 19:00:04
mysql的内存分配,是调优的重中之重,所以必须搞清楚内存是怎么分配的mysql> show global variables like %buffer%;+-------------------------+------------+| Variable_name ...

mysql的内存分配,是调优的重中之重,所以必须搞清楚内存是怎么分配的

mysql> show global variables like '%buffer%';+-------------------------+------------+| Variable_name      | Value   |+-------------------------+------------+| bulk_insert_buffer_size | 4194304  || innodb_buffer_pool_size | 2013265920 || innodb_change_buffering | inserts  || innodb_log_buffer_size | 8388608  || join_buffer_size    | 1048576  || key_buffer_size     | 16777216  || myisam_sort_buffer_size | 262144   || net_buffer_length    | 16384   || preload_buffer_size   | 32768   || read_buffer_size    | 1048576  || read_rnd_buffer_size  | 1048576  || sort_buffer_size    | 1048576  || sql_buffer_result    | OFF    |+-------------------------+------------+13 rows in set (0.01 sec)mysql> show global variables like '%cache%'; +------------------------------+----------------------+| Variable_name        | Value        |+------------------------------+----------------------+| binlog_cache_size      | 1048576       || have_query_cache       | YES         || key_cache_age_threshold   | 300         || key_cache_block_size     | 1024         || key_cache_division_limit   | 100         || max_binlog_cache_size    | 18446744073709547520 || query_cache_limit      | 1048576       || query_cache_min_res_unit   | 4096         || query_cache_size       | 0          || query_cache_type       | ON          || query_cache_wlock_invalidate | OFF         || table_definition_cache    | 256         || table_open_cache       | 100         || thread_cache_size      | 100         |+------------------------------+----------------------+14 rows in set (0.00 sec)
The maximum size of the key_buffer_size variable is 4 GB on 32 bit machines, and larger for 64 bit machines. MySQL recommends that you keep the key_buffer_size less than or equal to 25% of the RAM on your machine. This also depends on the other processes that use memory on the machine and it is wise to check if you consistently have 25% of free memory using the Linux command free. More on this later.

原标题:mysql中内存的使用与分配

关键词:MYSQL

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。