小内存VPS如何配置Mysql

  • A+
所属分类:LNMP

默认配置下mysql对于小内存的VPS来说是很耗费内存的。
按以下配置文件,可减少约100M内存开销

小内存VPS MySql配置文件修改如下(配置文件一般在/etc/my.cnf or /etc/mysql/my.cnf)

[mysqld]
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
skip-innodb

# this option may not work - if it doesn't simply omit it.
# known not to work in ubuntu 9.10, and likely other recent distributions as well.
skip-bdb

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: