mysql configurations

huakaibird發表於2016-05-17
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部落格 ” ,連結:http://blog.itpub.net/545828/viewspace-2101453/,如需轉載,請註明出處,否則將追究法律責任。

相關文章