server high load & eating memory

Hi , I have problems with my server always get high load & eating the ram then using swap so the server get hang within 5 minutes from startup !!! I dont realy know what is the problem

My server
AMD Athlon XP 2000+, 384K Cache
768 MB DDR-RAM
80 GB Hard Drive / 7200 RPM

I have only one site on this server ( 5000 vistors Daily )
with vbulletin forum + portal with 150 users online 24 hours

installed on the server
Apache 2.0
Php 4.3.10
Mysql 4.0.24


Top
10:42:33 up 11:15, 1 user, load average: 1.38, 0.42, 0.47
81 processes: 80 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 8.7% user 1.1% system 0.0% nice 0.0% iowait 90.1% idle
Mem: 764316k av, 757300k used, 7016k free, 0k shrd, 7144k buff
658184k actv, 35796k in_d, 16560k in_c
Swap: 1566328k av, 804556k used, 761772k free 26568k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
4613 apache 17 0 8828 7448 3044 S 10.8 0.9 0:01 0 httpd
14619 apache 17 0 10812 7128 2068 S 9.8 0.9 1:01 0 httpd
14635 apache 15 0 1126M 528M 268 D 2.9 70.8 1:08 0 httpd
1194 mysql 18 0 39712 11M 1172 S 0.9 1.5 5:36 0 mysqld
1 root 15 0 92 64 40 S 0.0 0.0 0:03 0 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kapmd
4 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd_CPU
9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush
5 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/DMA
7 root 15 0 0 0 0 SW 0.0 0.0 0:28 0 kscand/Normal
8 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/HighMe
10 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kupdated
11 root 23 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd
15 root 15 0 0 0 0 SW 0.0 0.0 0:01 0 kjournald
10:43:29 up 11:16, 1 user, load average: 0.97, 0.46, 0.48
81 processes: 79 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 0.0% user 0.4% system 0.0% nice 0.0% iowait 99.5% idle
Mem: 764316k av, 756496k used, 7820k free, 0k shrd, 7208k buff
652768k actv, 36088k in_d, 16028k in_c
Swap: 1566328k av, 795172k used, 771156k free 26652k cached
Unknown command `0' -- hit `h' for help
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
2917 apache 15 0 8504 6916 2800 S 0.4 0.9 0:07 0 httpd
5596 root 15 0 1192 1192 860 R 0.4 0.1 0:00 0 top
1 root 15 0 92 64 40 S 0.0 0.0 0:03 0 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kapmd
4 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd_CPU0
9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush
5 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/DMA
7 root 15 0 0 0 0 SW 0.0 0.0 0:28 0 kscand/Normal
8 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/HighMem
10 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kupdated
11 root 23 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd
15 root 15 0 0 0 0 SW 0.0 0.0 0:01 0 kjournald
695 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kjournald
1003 root 15 0 184 152 104 S 0.0 0.0 0:00 0 syslogd
1007 root 22 0 48 4 0 S 0.0 0.0 0:00 0 klogd
1077 root 25 0 44 4 0 S 0.0 0.0 0:00 0 apmd
1115 named 25 0 800 416 224 S 0.0 0.0 0:00 0 named
1129 root 15 0 356 192 116 S 0.0 0.0 0:00 0 sshd
1143 root 15 0 384 332 268 S 0.0 0.0 0:00 0 xinetd
1155 root 25 0 164 4 0 S 0.0 0.0 0:00 0 safe_mysqld
1194 mysql 17 0 39712 11M 1172 S 0.0 1.6 5:37 0 mysqld
1196 root 15 0 60 4 0 S 0.0 0.0 0:00 0 couriertcpd
1199 root 15 0 56 4 0 S 0.0 0.0 0:00 0 courierlogger
1208 root 25 0 60 4 0 S 0.0 0.0 0:00 0 couriertcpd
1211 root 25 0 44 4 0 S 0.0 0.0 0:00 0 courierlogger
1218 root 25 0 56 4 0 S 0.0 0.0 0:00 0 couriertcpd
1222 root 25 0 40 4 0 S 0.0 0.0 0:00 0 courierlogger
1229 root 25 0 60 4 0 S 0.0 0.0 0:00 0 couriertcpd
1234 root 25 0 44 4 0 S 0.0 0.0 0:00 0 courierlogger
1238 qmails 15 0 148 140 72 S 0.0 0.0 0:00 0 qmail-send
1240 qmaill 15 0 220 212 160 S 0.0 0.0 0:00 0 splogger
1241 root 15 0 140 96 60 S 0.0 0.0 0:00 0 qmail-lspawn
1242 qmailr 15 0 152 132 68 S 0.0 0.0 0:00 0 qmail-rspawn
1243 qmailq 15 0 72 64 24 S 0.0 0.0 0:00 0 qmail-clean
1266 root 22 0 17652 4 0 S 0.0 0.0 0:00 0 spamd
1277 popuser 25 0 17576 0 0 SW 0.0 0.0 0:00 0 spamd
1279 popuser 25 0 17576 0 0 SW 0.0 0.0 0:00 0 spamd
1292 root 15 0 2792 124 68 S 0.0 0.0 0:00 0 httpd
1339 postgres 15 0 496 248 160 S 0.0 0.0 0:00 0 postmaster
1341 postgres 25 0 336 4 0 S 0.0 0.0 0:00 0 postmaster


current my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = max_connections=400
set-variable = join_buffer=1M
set-variable = key_buffer=16M
set-variable = record_buffer=1M
set-variable = sort_buffer=1M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K

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

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




so what is the best setting for my.cnf & http.conf

 

 

 

 

Top