พีแตงครับ ... ของ รพ. ศูนย์ เพชรบูรณ์ นี่ connection เยอะได้ใจจริง ๆ
ผมเองก็กะว่าจะมาขอให้เทพ my.cnf ช่วยปรับเหมือนกันครับ
รบกวน อ. บอย(ด่านมะขามเตี้ย) อ. ตะนอย อ.ประทุม อ.ขวด อ.อ๊อด และเทพ ฯ อื่น ๆ ด้วยครับ
ช่วยเราสองคนด้วยครับ ...
วันนี้ลองใช้ 5.5.11 เลยล่ะครับ ผลเป็นดังภาพครับ
idle ลดลงไปเหลือน้อยที่สุด 6%
wcpu มากสุด เกือบ 400% เลย
[client]
#password = [your_password]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
default-storage-engine = INNODB
#default_table_type = INNODB not use in 5.5.x
back_log = 50
#skip-networking
max_connections = 400
#max_connect_errors = 10
#table_cache = 2048 not use in 5.5.x , use table_open_cache instead
table_open_cache = 2048
#external-locking
max_allowed_packet = 1G
binlog_cache_size = 1M
max_heap_table_size = 512M
sort_buffer_size = 2M
join_buffer_size = 2M
query_cache_size = 1024M
#default-character-set=tis620 use only with 5.1.x
#future release use --character-set-server instead
character-set-server=tis620
skip-character-set-client-handshake
init_connect = 'SET NAMES tis620'
transaction_isolation = REPEATABLE-READ
thread_concurrency = 8
thread_cache_size = 8
skip-name-resolve
#query_cache_limit = 2M
#ft_min_word_len = 4
#memlock
#thread_stack = 192K
#tmp_table_size = 64M
log-bin=mysql-bin
log_bin_trust_function_creators = 1
#binlog_format=mixed
#log_slave_updates
#log
#log_warnings
#slow_query_log
#long_query_time = 2
#log_long_format
tmpdir = /tmp
# *** Replication related settings
server-id = 1
#server-id = 2
#master-host = <hostname>
#master-user = <username>
#master-password = <password>
#master-port = <port>
#read_only
ssl-capath = /etc/ssl/mysql
ssl-key = /etc/ssl/mysql/server-key.pem
ssl-cert = /etc/ssl/mysql/server-cert.pem
ssl-ca = /etc/ssl/mysql/ca-cert.pem
#*** MyISAM Specific options
key_buffer_size = 1024M
read_buffer_size = 8M
read_rnd_buffer_size = 8M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
#myisam_max_extra_sort_file_size = 10G
# --myisam_max_extra_sort_file_size, It will be removed in a future
myisam_repair_threads = 1
myisam_recover
# *** INNODB Specific options ***
#skip-innodb
innodb_additional_mem_pool_size = 32M
innodb_file_per_table = 1
innodb_buffer_pool_size = 8G
innodb_data_file_path = ibdata1:10M:autoextend
innodb_data_home_dir = /usr/local/mysql/data
innodb_log_group_home_dir = /usr/local/mysql/data
#innodb_file_io_threads = 4
#innodb_force_recovery=1
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 2
innodb_fast_shutdown = 0
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
#innodb_max_dirty_pages_pct = 90
innodb_doublewrite = 0
innodb_flush_method=O_DIRECT
#innodb_flush_method=O_DSYNC
innodb_lock_wait_timeout = 50
innodb_support_xa = 0
innodb_open_files = 4000
innodb_locks_unsafe_for_binlog = 1
concurrent_insert = 2
[mysqldump]
quick
max_allowed_packet = 1G
allow-keywords
[mysql]
no-auto-rehash
default-character-set=tis620
# Only allow UPDATEs and DELETEs that use keys.
#safe-updates
[isamchk]
key_buffer = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[myisamchk]
key_buffer = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192