MYSQL 的优化
[mysqld]
set-variable = key_buffer=512M
set-variable = max_allowed_packet=4M
set-variable = table_cache=1024
set-variable = thread_cache=64
set-variable = join_buffer_size=32M
set-variable = sort_buffer=32M
set-variable = record_buffer=32M
set-variable = max_connections=512
set-variable = wait_timeout=120
set-variable = interactive_timeout=120
set-variable = max_connect_errors=30000
set-variable = long_query_time=1
set-variable = max_heap_table_size=256M
set-variable = tmp_table_size=128M
set-variable = thread_concurrency=8
set-variable = myisam_sort_buffer_size=128M
说明:
1)确认在“[mysqld]”部分加入了“skip-innodb”和“skip-bdb”参数;
2)确认在“[mysqld]”部分加入了“skip-name-resolve”和“skip-locking”参数;
3)如果不需要的话,可以将二进制日志(binlog)停掉,方法是将“log-bin”注释掉;
4)在内存允许的情况下,对一些参数进行重新配置,目标在于将大部分操作集中于内存中,尽量不进行磁盘操作。
ahaoxie