RAM 8G 時建議設定
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
default-storage-engine=MYISAM
character-set-server=utf8
collation-server=utf8_general_ci
user=mysql
symbolic-links=0
# global settings
table_cache=65535
table_definition_cache=65535
max_allowed_packet=4M
net_buffer_length=1M
bulk_insert_buffer_size=16M
query_cache_type=1
query_cache_size=8M
query_cache_limit=16M
# shared
key_buffer_size=64M
myisam_sort_buffer_size=32M
max_heap_table_size=128M
tmp_table_size=128M
# per-thread
sort_buffer_size=2M
read_buffer_size=128k
read_rnd_buffer_size=128k
join_buffer_size=256k
thread_stack=256k
binlog_cache_size=0
big-tables
innodb_file_per_table = 1
skip-external-locking
max_connections=3000
skip-name-resolve
slow_query_log
slow_query_log_file = /var/log/mysql-slow.log
long_query_time = 30
group_concat_max_len=65536
# according to tuning-primer.sh
thread_cache_size = 8
thread_concurrency = 16
# set variables
concurrent_insert=2