運行環境
CentOS 6.5
MySQL 5.6
購買了一個512M內存VPS服務器,在上面搭建了wordpress運行環境後,MySQL 有時候會被殺掉或者無法啓動。
故修改爲如下配置
[mysqld]
port = 3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
skip-external-locking
key_buffer_size = 2M
max_allowed_packet = 1M
table_open_cache = 128
sort_buffer_size = 128K
read_buffer_size = 1M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 4M
thread_cache_size = 10
query_cache_size= 0M
thread_concurrency = 8
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
character-set-server=utf8
collation-server=utf8_general_ci
key_buffer = 16K
query_cache_limit = 256K
max_allowed_packet = 1M
default-storage-engine=MYISAM
default-tmp-storage-engine=MYISAM
loose-skip-innodb
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[client]
default-character-set=utf8
放棄使用innodb,
修改後重啓MySQL,使用top -m 查看內存佔用降到76m左右