ITPub博客

首页 > 数据库 > MySQL > mysql configurations

mysql configurations

原创 MySQL 作者:huakaibird 时间:2016-05-17 15:19:54 0 删除 编辑
Configurations:


# Set buffer pool size to 50-80% of your computer's memory
innodb_buffer_pool_size=256M
innodb_additional_mem_pool_size=20M
#
# Set the log file size to about 25% of the buffer pool size
innodb_log_file_size=64M
innodb_log_buffer_size=8M

#
# Set key_buffer to 5 - 50% of your RAM depending on how much
# you use MyISAM tables, but keep key_buffer_size + InnoDB
# buffer pool size < 80% of your RAM
key_buffer_size=value

If not use MyISAM, use 16M -32M is OK



memory usage


innodb_buffer_pool_size
+ key_buffer_size
+ max_connections*(sort_buffer_size+read_buffer_size+binlog_cache_size)  
+ max_connections*2MB

So the max_connections can not configured too high, or it will use up memory cause mysql crash
Total buffers: 22.4G global + 1.5M per thread (2540 max threads) mysql mysqltuner.pl use this to calculate total usage


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/545828/viewspace-2101453/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: mysql view locks
下一篇: optimize table
请登录后发表评论 登录
全部评论
  • 博文量
    41
  • 访问量
    426500