BMS-HOSxP Community
HOSxP => MySQL => ข้อความที่เริ่มโดย: A ที่ กุมภาพันธ์ 26, 2010, 11:34:09 AM
-
รบกวนช่วยดูไฟล์ config ของ my.cnf ให้ด้วยครับว่า มีอะไรผิดพลาดหรือปล่าว ขอบคุณครับ
CentOS 5.4 64 bit Ram 8 G
MySQL percona-5.1.42-9.rhel5 64 bit
ไฟล์ config ของ my.cnf ที่ใช้อยู่ครับ
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=tis620
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
#key_buffer = 40-50 % of RAM
key_buffer = 2400M
max_allowed_packet = 1024M
max_heap_table_size = 2048M
max_connections=2000
table_cache = 1500
table_open_cache = 1500
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
#myisam_sort_buffer_size = 10-20 % of RAM
myisam_sort_buffer_size = 1024M
myisam_max_sort_file_size = 2048M
myisam_max_extra_sort_file_size = 2048M
myisam_repair_threads = 1
myisam_recover
thread_cache_size = 8
query_cache_type=1
#query_cache_size= 10 % of RAM
query_cache_size= 720M
thread_concurrency = 8
default-character-set=tis620
skip-name-resolve
skip-character-set-client-handshake
skip-locking
init_connect = 'SET NAMES tis620'
big-tables
default-storage-engine = INNODB
join_buffer_size = 4M
concurrent_insert = 2
join_buffer_size = 2M
concurrent_insert = 2
log_bin_trust_function_creators = 1
innodb_file_per_table
innodb_data_home_dir = /var/lib/mysql/
innodb_log_group_home_dir = /var/lib/mysql/
#interactive_timeout = 600
#wait_timeout = 1200
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/
############################# mysql 5.1.X
#innodb_log_arch_dir = /var/lib/mysql/
#############################
#innodb_buffer_pool_size = 40-60 % of RAM
innodb_buffer_pool_size = 4200M
innodb_additional_mem_pool_size = 24M
innodb_log_file_size = 512M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_thread_concurrency = 0
#ulimit -n 30000
innodb_support_xa=0
innodb_open_files = 2000
innodb_locks_unsafe_for_binlog=1
innodb_flush_method=O_DIRECT
innodb_doublewrite=0
innodb_adaptive_checkpoint = 1
innodb_io_capacity = 10000
innodb_write_io_threads = 16
innodb_read_io_threads = 16
[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
-
ไม่ทราบว่าแก้ไขอย่างไรไปบ้างแล้วครับ พอดีที่ รพ. ก็ประสบอยู่เหมือนกันครับ
-
ใช้คำสั่ง top แล้วกดปุ่ม shift+M แล้วส่งหน้าจอเข้ามาครับ
-
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=tis620
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
#key_buffer = 40-50 % of RAM
key_buffer = 2400M --> 256M
max_allowed_packet = 1024M
max_heap_table_size = 2048M -->512M
max_connections=2000-->500
table_cache = 1500
table_open_cache = 1500
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
#myisam_sort_buffer_size = 10-20 % of RAM
myisam_sort_buffer_size = 1024M
myisam_max_sort_file_size = 2048M
myisam_max_extra_sort_file_size = 2048M
myisam_repair_threads = 1
myisam_recover
thread_cache_size = 8
query_cache_type=1
#query_cache_size= 10 % of RAM
query_cache_size= 720M
thread_concurrency = 8
default-character-set=tis620
skip-name-resolve
skip-character-set-client-handshake
skip-locking
init_connect = 'SET NAMES tis620'
big-tables
default-storage-engine = INNODB
join_buffer_size = 4M-->ซ้ำครับ เอาออกไปเลยก็ได้
concurrent_insert = 2
join_buffer_size = 2M
concurrent_insert = 2
log_bin_trust_function_creators = 1
innodb_file_per_table
innodb_data_home_dir = /var/lib/mysql/
innodb_log_group_home_dir = /var/lib/mysql/
#interactive_timeout = 600
#wait_timeout = 1200
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/
############################# mysql 5.1.X
#innodb_log_arch_dir = /var/lib/mysql/
#############################
#innodb_buffer_pool_size = 40-60 % of RAM
innodb_buffer_pool_size = 4200M
innodb_additional_mem_pool_size = 24M
innodb_log_file_size = 512M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_thread_concurrency = 0
#ulimit -n 30000
innodb_support_xa=0
innodb_open_files = 2000
innodb_locks_unsafe_for_binlog=1
innodb_flush_method=O_DIRECT
innodb_doublewrite=0
innodb_adaptive_checkpoint = 1
innodb_io_capacity = 10000
innodb_write_io_threads = 16
innodb_read_io_threads = 16
[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
-
oracle 6.0+mysql 5.5 ไปเลย อันนี my.cnf 8 gb for mysql 5.5
##############################
################## Star MySQL-Config #####################
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=tis620
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
server-id = 1
skip-external-locking
skip-federated
big-tables
character-set-server=tis620
key_buffer = 512M
max_allowed_packet = 512M
table_open_cache = 2048
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 128M
thread_cache_size = 8
query_cache_size= 256M
thread_concurrency = 8
low_priority_updates=1
skip-name-resolve
skip-character-set-client-handshake
init_connect = 'SET NAMES tis620'
max_connections = 150
################## InnoDB #######################
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/
innodb_buffer_pool_size = 4500M
innodb_additional_mem_pool_size = 24M
innodb_log_file_size = 512M
innodb_file_per_table =1
innodb_log_buffer_size = 8M
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_thread_concurrency = 8
innodb_flush_method=O_DIRECT
innodb_checksums=0
innodb_doublewrite=0
innodb_support_xa=0
innodb_max_dirty_pages_pct=90
innodb_open_files = 2048
innodb_locks_unsafe_for_binlog=1
join_buffer_size = 2M
concurrent_insert = 2
max_heap_table_size = 512M
[mysqldump]
quick
max_allowed_packet = 512M
allow-keywords
[mysql]
no-auto-rehash
default-character-set=tis620
[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
################# End MySQL-Config #################
-
;D ;D ;D restart บ่อยๆแบบไหนครับ server restart ตัว mysql service เองใช่ป่าวครับ
-
นานมากแล้วนะครับ กระทู้นี้ ;D ;D
ปัญหาที่เจอก็คืออาการค้างบ่อย ๆ เรียกได้ว่าทุกวันเลยก้ว่าได้ ต้องใช้วิธี restart mysql
ถึงจะรันระบบต่อไปได้ จนเมื่อ อจ.ออก stable 54.2.2 จึงบังคับให้อับผ่าน lan เป็น version เดียวกันทั้งระบบ
อาการที่เคยเป็นก็หายไปเลยครับ ขอบคุณที่เข้ามาอ่านนะครับ
(เสียดายจังไม่ได้ไปเข้าอบรม server ไว้คราวหน้าถ้ามีโอกาสจะพยายามไปให้ได้แน่ ๆครับ) ;D ;D