Forum Moderators: open

Message Too Old, No Replies

Config my.cnf waht's the best?

         

fdr2004

7:13 am on May 14, 2007 (gmt 0)

10+ Year Member



I have mod my.cnf, i include max connections. But still get difficulties to access my site. before i had modificate my.cnf with max con. i get the error to many connection. after that i get Server Too Busy and slow

what's the best solution to mod. my.cnf mysql

this is my conf. of my.cnf at the moment

[client]
port=3306
socket=/var/lib/mysql/mysql.sock

[mysqld]
port=3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
set-variable = key_buffer=256M
set-variable = key_buffer_size=16M
set-variable = table_cache=256
set-variable = sort_buffer=1M
set-variable = max_allowed_packet=1M
set-variable = record_buffer=1M
set-variable = myisam_sort_buffer_size=64M
set-variable = thread_cache=8
set-variable = max_connections=600
set-variable = thread_concurrency=8
log-bin
server-id=1

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

thanks

Bolotomus

7:47 am on May 14, 2007 (gmt 0)

10+ Year Member



Here's mine, from a 4 Gb database server I run


key_buffer = 1G
max_allowed_packet = 8M
thread_stack = 128K
sort_buffer_size = 16M
thread_cache = 200
thread_cache_size = 256
table_cache = 768

Setting your key_buffer size big enough is a very important issue. Here's a real good tip to find out if you have enough in your key_buffer_size:

For example on my server, I found that Key_read_requests=2546754640 and Key_reads=1221270. Now I compute the ratio, and I find that the ratio of requests to reads is 2085.33. In other words, out of every 2085.33 requests it does one "real" read.

Anything over 1000 is excellent. So I am happy with the amount of RAM I threw at my key_buffer_size. (I threw a whole gigabyte at it. I hope that would be enough!)

Unfortunately this is only one issue out of a hundred issues. A real good question to ask yourself is, do you have enough RAM to do all the things that you are telling mysql to do? I used to have load problems and I kept upping the values, higher, and higher, and the server got slower, and slower. Then I discovered that if I just go in the OTHER direction... ;-)

fdr2004

6:52 am on May 15, 2007 (gmt 0)

10+ Year Member



I have more the impresion the there is a log that is to big. when i reboot the server afther 24 hours than is working everything back normal for the next 24 hours.

?
FDR