List:General Discussion« Previous MessageNext Message »
From:Blog Tieng Viet Date:July 3 2009 2:37pm
Subject:How to tune my Mysql server ?
View as plain text  
Dear all,
 
I am running mysql server sharing with apache web server in a box of freebsd 6.4. Hardware
spec is roughly as bellow:
CPU: Xeon 3.06GHz x 2
Mem: 4GB
 
The version of Mysql is 5.1.17_beta, a pre-complied binary package for FreeBSD.
 
Recently the apache request raises quickly, sometime up to 250~300 requests.
As a result, mysql response so slowly and sometime encounter errors of over memory or
crash tables.
 
So I try to change my.cnf to make some memory related parameters go up to twice, but MySQL
take 80~90% CPU power. The parameters of my.cnf before and after changing are flowing (the
value commented by # is before)
 
[mysqld]
port  = 3306
socket  = /tmp/mysql.sock
skip-locking
key_buffer = 640M #384M
max_allowed_packet = 2M #1M
table_cache = 1028 #512
sort_buffer_size = 4M #2M
read_buffer_size = 4M #2M
read_rnd_buffer_size = 16M #8M
myisam_sort_buffer_size =128M # 64M
thread_cache_size = 16# 8
query_cache_size = 64M#32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
wait_timeout=20
thread_cache = 240#120
max_connection = 350
log-slow-queries = /usr/local/mysql/mysql-slow.log
long_query_time=2
 
I would like to receive an advice for changing parameters.
 
Best regards.
 
Nhat HV
 
 


      
Thread
How to tune my Mysql server ?Blog Tieng Viet3 Jul