在小型VPS中减少MySQL的内存消耗

#
# * Fine Tuning
#
key_buffer = 16M 改成16K
max_allowed_packet = 16M 改成1M
thread_stack = 192K 改成64K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64 改成4,并启用
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M

并添加

sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K

还要添加
skip-innodb
skip-bdb
因为这两种高级数据库文件(BerkeleyDB)用不着,一般用的是MyISAM

这样调整后, MySQL的内存消耗会减少100MB

猜你喜欢

转载自cowaw.iteye.com/blog/832294