
|
View Full Version : MySQL tuning, need expert suggestions
Hi
I only run ONe site on my server, XP2500 with 1G DDR, cpanel.
Here is my TOP
17:24:02 up 1 day, 16:24, 1 user, load average: 0.27, 0.23, 0.12
135 processes: 133 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 2.5% user 1.1% system 0.1% nice 0.0% iowait 96.0% idle
Mem: 998592k av, 984152k used, 14440k free, 0k shrd, 122948k buff
687692k actv, 24k in_d, 27100k in_c
Swap: 2048276k av, 135436k used, 1912840k free 532360k cached
as you could see that loading is low but I have started using cache and it is still growing!!! now it is 130mbs
my my.cnf is as follows, Ihave tuned it for a while.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=16M
query_cache_type=1
max_connections=500
interactive_timeout=10
wait_timeout=15
connect_timeout=10
thread_cache_size=64
key_buffer=20M
join_buffer=1M
max_allowed_packet=16M
table_cache=512
record_buffer=1M
sort_buffer_size=1M
read_buffer_size=2M
tmp_table_size=32M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=16M
log-bin
server-id=1
is it ok to have BIG cache? I once had 700MB with only that site, it is a php/MySQL forum,IPB board.
thanks for your kind helps
:D :)
Steven 12-31-2003, 05:30 AM [mysqld]
skip-locking
set-variable = key_buffer=24M
set-variable = join_buffer=1M
set-variable = record_buffer=1M
set-variable = sort_buffer=2M
set-variable = tmp_table_size=32M
set-variable = table_cache=800
set-variable = max_connections=500
set-variable = thread_concurrency=2
set-variable = thread_cache_size=600
set-variable = max_allowed_packet=5M
set-variable = connect_timeout=5
set-variable = query_cache_limit=1M
set-variable = query_cache_size=32M
set-variable = query_cache_type=1
set-variable = wait_timeout=5
set-variable = table_cache=30
log-bin
server-id=1
try that out, feel free to contact me on msn about this issue
Hi
you have two table_cache, is it ok?
I am running mySQL 4.0.15, Iguess I do not need "set-variable" though
Steven 12-31-2003, 05:50 AM remove set-variable = table_cache=800
having set-variable wont make a difference
HI I notice that you change to max_allowed_packet =5M.
is there any particular reasons for this? it is usually 16mb
Steven 12-31-2003, 05:30 PM you can change it to 16 if you really need it, most people arnt doing a lot of blob querys
Hi the linuxguy
Thanks for your helps. After few days' watches, it is quiet no changes.
Loading is LOW but 180mb cache are used, no ideas why. something intersting is physical ram has 200mb something free...
00:31:59 up 5 days, 23:32, 1 user, load average: 0.24, 0.20, 0.19
164 processes: 161 sleeping, 3 running, 0 zombie, 0 stopped
CPU states: 5.9% user 2.3% system 0.0% nice 0.0% iowait 91.6% idle
Mem: 998592k av, 743644k used, 254948k free, 0k shrd, 139452k buff
519420k actv, 3856k in_d, 21304k in_c
Swap: 2048276k av, 185732k used, 1952544k free 314688k cached
goldenplanet 01-05-2004, 04:48 AM You need to understand what you're looking at! ;)
Linux allocates unused physical RAM for cache so if you monitor the server for a while you'll probably see available physical memory decrease while the cache grows - and that's how it's supposed to be.
The cache helps lowering the general load on your server because the most accessed files are fetched from RAM instead of your harddrive and you'll actually see a performance degradation if the cache goes below 100-150 MB, depending on your hardware (RAID, SCSI-controller etc.).
Don't worry about swap in the current situation - it just means that your system has identified data that are inactive (hasn't been accessed for a while) and has moved them to swap in order to make room for more frequently used data or a bigger cache.
That was the long version - the short version is that your system appears to be running fine.
Steven 01-05-2004, 05:10 AM well put goldenplanet
example:
9:09am up 29 days, 5:30, 1 user, load average: 0.03, 0.05, 0.04
108 processes: 104 sleeping, 4 running, 0 zombie, 0 stopped
CPU states: 1.6% user, 1.1% system, 0.0% nice, 0.3% idle
Mem: 506048K av, 496856K used, 9192K free, 0K shrd, 106400K buff
Swap: 1052216K av, 73464K used, 978752K free 269452K cached
Hi Golden planet
Thanks so much indeed.^^
this is a great learning to me.
Thanks thelinuxguy as well.
jori
Originally posted by goldenplanet
You need to understand what you're looking at! ;)
Linux allocates unused physical RAM for cache so if you monitor the server for a while you'll probably see available physical memory decrease while the cache grows - and that's how it's supposed to be.
The cache helps lowering the general load on your server because the most accessed files are fetched from RAM instead of your harddrive and you'll actually see a performance degradation if the cache goes below 100-150 MB, depending on your hardware (RAID, SCSI-controller etc.).
Don't worry about swap in the current situation - it just means that your system has identified data that are inactive (hasn't been accessed for a while) and has moved them to swap in order to make room for more frequently used data or a bigger cache.
That was the long version - the short version is that your system appears to be running fine.
|