I need a help with tuning parameters in my.cnf for efficient work of my web-site. I’ve been reading different articles, forum entries etc. regarding this topic, however I still keep getting problems.
Depending on the value of max_user_connection I either get an error saying that it’s too low(if it’s less than 300), or my server goes down after mysql taking all the server resources(if max_user_connections if over 300).
Can someone give me advices regarding tuning my.cnf options?
On my server, I have a 1 WordPress blog with multi-site option enabled. This is a news web-site with a very large traffic. I have 6 GB of RAM on the server.
Here’s my current settings:
skip-locking
safe-show-database
myisam_sort_buffer_size=96M
interactive_timeout=50
wait_timeout=10
connect_timeout=10
max_user_connections=150
max_connections=400
max_heap_table_size = 32M
max_connect_errors=10
key_buffer=256M
join_buffer=2M
record_buffer=2M
sort_buffer=64M
max_allowed_packet=24M
query_cache_limit = 128M
query_cache_size = 512M
query_cache_type = 1
query_prealloc_size = 65K
query_alloc_block_size = 128K
read_buffer_size=1M
read_rnd_buffer_size=768K
log_slow_queries = /tmp/slow.log
tmp_table_size=128M
table_cache=4096
thread_cache=1024
thread_concurrency=8
There is no magic answer to improving your MySQL server performance. You need to make a change, then restart your MySQL server and benchmark.
Make sure your thread concurrency is set to 2x the number of cores in the server’s CPU.
You may want to try increasing your query cache size also, if its too small then you may have a lot of cache fragmentation (which degrades performance).