`
andrew1024
  • 浏览: 74198 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

在小型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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics