PDA

View Full Version : Server Used a little Swap... Can this be Prevented with Tweaking?


LancerForums
Sun 12th Jan '03, 2:23pm
I was looking at my top and noticed that at some point the server used a little swap: 2:09pm up 3 days, 20:28, 1 user, load average: 0.48, 0.68, 0.63
133 processes: 130 sleeping, 3 running, 0 zombie, 0 stopped
CPU states: 26.7% user, 6.0% system, 0.0% nice, 67.2% idle
Mem: 1031184K av, 1016808K used, 14376K free, 0K shrd, 78936K buff
Swap: 1044216K av, 5236K used, 1038980K free 802480K cachedThe server specs are:
P4 2.0 GHz 1GB RAM 80GB (7200RPM) Hard Drive RH Linux 7.2My site is 100% Mysql/PHP driven if that helps any.

my.cnf:[mysqld]
port = 3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
set-variable = max_connections=450
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=9600
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]
open_files_limit=8192
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysqldump]
quick
set-variable = max_allowed_packet=16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[mysqlhotcopy]
interactive-timeout

dbstats.php:
http://www.evolutionm.net/dbstats.php

The server has been fine up to now, I'd just like to prevent using swap because that makes anything slow. It seems like I have enough RAM too.

Thanks,

Mark

Joe Gronlund
Sun 12th Jan '03, 3:48pm
try using this config for a while , see if it helps, works great on my server.
also talk to george-(eva2000), havent seen him around lately though



[mysqld]
set-variable = max_connections=650
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=14400
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10
[safe_mysqld]
open_files_limit=8192
[mysqldump]
quick
set-variable = max_allowed_packet=16M
[myisamchk]
set-variable = key_buffer=64M
set-variable = sort_buffer=64M
set-variable = read_buffer=16M
set-variable = write_buffer=1

LancerForums
Sun 12th Jan '03, 11:11pm
Are your server specs similar?

Our server does just fine most of the time, but every once it a while it starts using some disk swap, but I can't understand why when there's so much memory sitting in the cache. Is there some setting I can alter to fix this problem? We have about 140-200 people on when it's busiest I think.

Thanks,

Mark

LancerForums
Sun 12th Jan '03, 11:14pm
Originally posted by LancerForums
Are your server specs similar?

Our server does just fine most of the time, but every once it a while it starts using some disk swap, but I can't understand why when there's so much memory sitting in the cache. Is there some setting I can alter to fix this problem? We have about 140-200 people on when it's busiest I think.

Thanks,

Mark hmmm, nevermind... it looks like most of the memory is being used up right? The buffer amount is very low. Does this mean I need more memory to run better, or do I most likely have a memory leak?

Mark

Joe Gronlund
Mon 13th Jan '03, 12:14am
Originally posted by LancerForums
Are your server specs similar?

Our server does just fine most of the time, but every once it a while it starts using some disk swap, but I can't understand why when there's so much memory sitting in the cache. Is there some setting I can alter to fix this problem? We have about 140-200 people on when it's busiest I think.

Thanks,

Mark

i have 1.5GB ram and 1 Ghz processor, other specs are the same or close

eva2000
Mon 13th Jan '03, 8:36pm
a little swap to disk is okay depending on the amount of memory you have

> 1GB of ram, 1-10mb swapping is okay

i haven't been around due to my dad having an accident and loosing 2 of his fingers :(