Web Hosting Talk







View Full Version : MySQL Configuration


Nakor
12-18-2004, 07:14 PM
I was hoping someone could suggest an optimized configuration for my server's mysql config. My server is 2.8ghz with 1gb ram. My current config looks like this:
[mysqld]

skip-locking
key_buffer=128M
join_buffer=1M
record_buffer=1M
sort_buffer=2M
table_cache=1024
max_connections=300
thread_cache_size=64
max_allowed_packet=5M
connect_timeout=10
thread_concurrency=2
wait_timeout=10
tmp_table_size=48M
query_cache_size=64
query_cache_limit=4M
query_cache_type=1

Unfortunately my server crashes if i have the forums online for more than 5 minutes. I think it's my MySQL config so can someone please help me by pointing out ways I could fix it?

Cheers.

~Joe

Dssripper
12-18-2004, 09:38 PM
Try using my-large.cnf as your my.cnf
see if that helps


Dss

arun_ns
12-19-2004, 11:27 AM
Hi,

You can also try this configuration

edit your /etc/my.cnf like

[mysqld]

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = max_connections=500
set-variable = key_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=1M
set-variable = record_buffer=1M
set-variable = sort_buffer=2M
set-variable = table_cache=1024
set-variable = thread_cache_size=256
set-variable = wait_timeout=3600
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10

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

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

[mysqldump]
quick
set-variable = max_allowed_packet=16M