BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: invisible_deaw ที่ สิงหาคม 10, 2013, 11:57:27 AM
-
มีใครยังว่างใหมอะครับ รบกวนช่วยดู server ผมให้หน่อครับ ???
-
เป็นอะไรครับ ... อธิบายหน่อย ... จะได้รู้ว่าเกิดปัญหาไร ...
-
มัน error เเบบนี้อะครับ 130810 13:50:48 [ERROR] /usr/local/mysql/libexec/mysqld: Sort aborted
เเล้ว db มันไม่ไปต่อเลย ตอนนี้ผมปิดระบบทุกอย่าง พร้อมทั้ง reboot สามารถไปต่อได้เเต่ cpu peak มากครับ
-
my.cnf Config ไว้อย่างไรบ้าง
-
server dell power Edge R710 Intel Xeon E5620 2.4 GHz
Ram 8 GB ครับ เนื่องจากผมมาดูต่อจากคนเก่า ที่เอาคอนฟิกเดิมๆ เเล้วพอมี transection เเล้วมันช้าเเล้วอีกอย่างที่ไช้อยู่เป็น engine ของ MyIsam ครับไม่ได้ enable InnoDB เเต่อย่างใด เครื่องลง 32 bits ไว้ครับเเละใช้ MySql 5.1.42
config เก่าครับเดิมๆเลย my.cnf ของเก่า
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
interactive_timeout=100
wait_timeout=100
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 32M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 1M
net_buffer_length = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 8M
set-variable=max_connections=640
tmp_table_size = 32M
max_tmp_tables = 32M
query_cache_size=32M
old_passwords
log-slow-queries
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
แล้วผมได้คอนฟิกไหม่ไปเเต่ยังไม่ได้เปลี่ยนนะครับ
################################################################################
#DESCRIPTION: MySQL config 5.0.x, 5.1.x, 5.5.x
#RAM: 6GB RAM dedicated server
#Connections: 350 connections
################################################################################
[mysqld]
interactive_timeout=1000
wait_timeout=1800
#character-set-server = tis620
#collation-server = tis620_thai_ci
## Files
#back_log = 300
#open-files-limit = 8192
#open-files = 1024
port = 3306
socket = /tmp/mysql.sock
#pid-file = /tmp/mysql.pid
skip-external-locking
#skip-name-resolve
## Logging
datadir = /usr/local/mysql/var/
old_passwords
log_bin = mysql-bin
long_query_time = 10
log-slow-queries
server-id =1
max_binlog_size = 256M
expire_logs_days = 7
## Per-Thread Buffer memory utilization equation: (read_buffer_size + read_rnd_buffer_size + sort_buffer_size + thread_stack + join_buffer_size + binlog_cache_size) * max_connections
thread_stack = 32K
sort_buffer_size = 1024K
read_buffer_size = 1024K
read_rnd_buffer_size = 4096K
join_buffer_size = 1024K
binlog_cache_size = 64K
## Query Cache
query_cache_size = 64M
query_cache_limit = 64M
query_cache_type = 1
## Connections
max_connections = 350
max_connect_errors = 100
connect_timeout = 30
max_allowed_packet = 32M
## Default Table Settings
#sql_mode = NO_AUTO_CREATE_USER
## Table and TMP settings
max_heap_table_size = 512M
bulk_insert_buffer_size = 512M
tmp_table_size = 512M
## Table cache settings
table_cache = 64M
table_open_cache = 64M
table_definition_cache = 64M
## Thread settings
thread_concurrency = 16
thread_cache_size = 100
## MyISAM Engine
key_buffer = 256M
myisam_sort_buffer_size = 256M
myisam_max_sort_file_size = 2G
#myisam_repair_threads = 2
#myisam_recover = QUICK,BACKUP
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqldump]
max_allowed_packet = 128M
-
ใช้ HOSxP Database มีความจำเป็นต้องทำ Table เป็น Innodb ด้วยนะครับ และต้องปรับค่า my.cnf ใหม่ เพราะตั้งค่าไว้ไม่เหมาะสมกับการใช้งานครับ
-
มัน error เเบบนี้อะครับ 130810 13:50:48 [ERROR] /usr/local/mysql/libexec/mysqld: Sort aborted
เเล้ว db มันไม่ไปต่อเลย ตอนนี้ผมปิดระบบทุกอย่าง พร้อมทั้ง reboot สามารถไปต่อได้เเต่ cpu peak มากครับ
Load average ขึ้นสูง ซึ่งจริงๆไม่ควรเกิน 4 แต่ถ้าเป็น 2 หลักนี่อาการหนัด (จากรูปมีค่าเป็น 9.3)
Ram ยังเหลือ แต่ IO wait ขึ้นเยอะพอสมควร (15.1%)
ถ้า Table เป็น InnoDB แล้วคิดว่าน่าจะมีปัญหาในการอ่านเขียนข้อมูลจึงทำให้ cpu ทำงานหนัก
อยากให้ลองตรวจสอบดูพื้นที่ hdd ด้วยคำสั่ง df -h ว่าเหลือเนื้อที่เท่าไหร่ครับ
(ส่วนใหญ่ที่ทำการ reboot แล้วทำงานต่อได้เพราะเครื่องมีการ Clear temp file จึงทำให้เนื้อที่ใน hdd เพิ่มขึ้น)
จริงๆต้องดูรายละเอียดมากกว่านี้ จึงจะสามารถหาต้นเหตุปัญหาได้ตรงจุด
-
น่าจะเป็นอันนี้ ใช้ server slave ของ mysql ด้วยหรือเปล่าครับ ;D
ถ้า server ไม่แรงจริงอย่าทำเลยครับมันจะอืดครับ....
## Logging
datadir = /usr/local/mysql/var/
old_passwords
log_bin = mysql-bin
long_query_time = 10
log-slow-queries
server-id =1
max_binlog_size = 256M
expire_logs_days = 7
-
ลง os ใหม่ให้เป็น 64bit ครับไม่งั้นแก้ปัญหาไม่จบ Mysql 5.5 และ engine ต้องปรับ Innodb ให้มากที่สุด
server dell power Edge R710 Intel Xeon E5620 2.4 GHz
Ram 8 GB ครับ เนื่องจากผมมาดูต่อจากคนเก่า ที่เอาคอนฟิกเดิมๆ เเล้วพอมี transection เเล้วมันช้าเเล้วอีกอย่างที่ไช้อยู่เป็น engine ของ MyIsam ครับไม่ได้ enable InnoDB เเต่อย่างใด เครื่องลง 32 bits ไว้ครับเเละใช้ MySql 5.1.42
config เก่าครับเดิมๆเลย my.cnf ของเก่า
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
interactive_timeout=100
wait_timeout=100
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 32M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 1M
net_buffer_length = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 8M
set-variable=max_connections=640
tmp_table_size = 32M
max_tmp_tables = 32M
query_cache_size=32M
old_passwords
log-slow-queries
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
แล้วผมได้คอนฟิกไหม่ไปเเต่ยังไม่ได้เปลี่ยนนะครับ
################################################################################
#DESCRIPTION: MySQL config 5.0.x, 5.1.x, 5.5.x
#RAM: 6GB RAM dedicated server
#Connections: 350 connections
################################################################################
[mysqld]
interactive_timeout=1000
wait_timeout=1800
#character-set-server = tis620
#collation-server = tis620_thai_ci
## Files
#back_log = 300
#open-files-limit = 8192
#open-files = 1024
port = 3306
socket = /tmp/mysql.sock
#pid-file = /tmp/mysql.pid
skip-external-locking
#skip-name-resolve
## Logging
datadir = /usr/local/mysql/var/
old_passwords
log_bin = mysql-bin
long_query_time = 10
log-slow-queries
server-id =1
max_binlog_size = 256M
expire_logs_days = 7
## Per-Thread Buffer memory utilization equation: (read_buffer_size + read_rnd_buffer_size + sort_buffer_size + thread_stack + join_buffer_size + binlog_cache_size) * max_connections
thread_stack = 32K
sort_buffer_size = 1024K
read_buffer_size = 1024K
read_rnd_buffer_size = 4096K
join_buffer_size = 1024K
binlog_cache_size = 64K
## Query Cache
query_cache_size = 64M
query_cache_limit = 64M
query_cache_type = 1
## Connections
max_connections = 350
max_connect_errors = 100
connect_timeout = 30
max_allowed_packet = 32M
## Default Table Settings
#sql_mode = NO_AUTO_CREATE_USER
## Table and TMP settings
max_heap_table_size = 512M
bulk_insert_buffer_size = 512M
tmp_table_size = 512M
## Table cache settings
table_cache = 64M
table_open_cache = 64M
table_definition_cache = 64M
## Thread settings
thread_concurrency = 16
thread_cache_size = 100
## MyISAM Engine
key_buffer = 256M
myisam_sort_buffer_size = 256M
myisam_max_sort_file_size = 2G
#myisam_repair_threads = 2
#myisam_recover = QUICK,BACKUP
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqldump]
max_allowed_packet = 128M
-
8) ส่วนของ
[mysqld] เพิ่ม
event_scheduler = 1
query_cahe_type = 2
8) ในแฟ้ม my.cnf ก่องขอรับ 8)
8) แล้ว reboot server 1 ครั้ง ก่อง RUN เต็มระบบ ขอรับ 8)
-
8) ส่วนของ
[mysqld] เพิ่ม
event_scheduler = 1
query_cahe_type = 2
8) ในแฟ้ม my.cnf ก่องขอรับ 8)
8) แล้ว reboot server 1 ครั้ง ก่อง RUN เต็มระบบ ขอรับ 8)
event_scheduler = 1
query_cahe_type = 2
ขอบคุณครับ ว่าเเต่สองค่านี้ไว้ทำอะไรหรอครับ ช่วยบอกความหมายหน่อยนะครับ