mysql5.0.75構成の最適化


サーバーは2950、16 Gメモリ、raid 10、データは9 G余り、innodb、myisamがあり、innodbが多い.
[client]
#password       = [your_password]
port            = 3306
socket          = /tmp/mysql.sock

[mysqld]
# generic configuration options
port            = 3306
socket          = /tmp/mysql.sock
skip-locking

#      mysql       
 memlock  
 innodb_flush_method=O_DIRECT

skip-name-resolve
bind_address=192.168.0.187
back_log = 64
max_connections = 500
max_connect_errors = 10
table_cache = 4096
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 128M
sort_buffer_size = 16M
join_buffer_size = 16M
thread_cache_size = 64
thread_concurrency = 8
query_cache_size = 256M
query_cache_limit = 4M
query_cache_type = 1
ft_min_word_len = 4
default_table_type = MYISAM
thread_stack = 256K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 128M
log-bin=mysql-bin
expire_logs_days = 10
log_slow_queries = slow.log
log-queries-not-using-indexes
long_query_time = 2
log_long_format
tmpdir = /tmp
server-id = 1
key_buffer_size = 768M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
# Automatically check and repair not properly closed MyISAM tables.
myisam_recover

# Disable Federated by default
skip-federated
skip-bdb
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 5G
innodb_data_file_path = ibdata1:5000M;ibdata2:3000M:autoextend
innodb_data_home_dir = /opt/app/mysql/var
innodb_file_io_threads = 4
innodb_thread_concurrency = 0
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8M
innodb_log_file_size = 512M
# Total number of files in the log group. A value of 2-3 is usually good
# enough.
innodb_log_files_in_group = 3
# Location of the InnoDB log files. Default is the MySQL datadir. You
# may wish to point it to a dedicated hard drive or a RAID1 volume for
# improved performance
innodb_log_group_home_dir=/opt/app/mysql/var
innodb_log_arch_dir=/opt/app/mysql/var
innodb_max_dirty_pages_pct = 90
# The flush method InnoDB will use for Log. The tablespace always uses
# doublewrite flush logic. The default value is "fdatasync", another
# option is "O_DSYNC".
#innodb_flush_method=O_DSYNC
innodb_lock_wait_timeout = 120