182
« เมื่อ: เมษายน 07, 2011, 11:29:30 AM »
สวัสดีครับ ทุกท่านที่เป็นเซียน mysql ทั้งหลาย ตอนนี้ผมมีปัญหากับ mysql ครับมัน ช้าเแบบหน่วงๆๆ นะครับ
mysql 5.1.39 server ipm cpu 4 คอ Ram 20 GB ผมปรับ my.cnf ดังนี้ครับ
กราฟเป็นดังภาพ
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=tis620
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
# Please change key_buffer to 30% of physical memory
key_buffer = 1024M
max_allowed_packet = 1024M
table_cache = 1800
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
# Please change myisam_sort_buffer_size to 20# of physical memory
myisam_sort_buffer_size = 2G
thread_cache = 16
# Please change query_cache_size to 10% of physical memory
query_cache_size= 1024M
thread_concurrency = 16
default-character-set=tis620
skip-name-resolve
innodb_file_per_table
skip-character-set-client-handshake
init_connect = 'SET NAMES tis620'
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
#Please change innodb_buffer_pool_size to 60% of physical memory
innodb_buffer_pool_size = 11G
innodb_additional_mem_pool_size = 20M
innodb_log_file_size = 256M
innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
############################################
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_doublewrite=0
innodb_support_xa = 0
#innodb_open_files = 900
innodb_open_files = 2000
innodb_locks_unsafe_for_binlog=1
join_buffer_size = 2M
concurrent_insert = 2
max_connections=800
innodb_adaptive_checkpoint = 1
innodb_io_capacity = 10000
innodb_write_io_threads = 16
innodb_read_io_threads = 16
innodb_support_xa = 0
innodb_doublewrite = 0
innodb_table_locks = 0
#########################################
#in case of emergency innodb table crash
#innodb_force_recovery = 1
##########################################
[mysqldump]
quick
max_allowed_packet = 1024M
allow-keywords
[mysql]
no-auto-rehash
default-character-set=tis620
[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout