High server load and "resource outage" error

I have a VPS with guaranteed RAM 256 MB and burstable RAM 1 GB.
and also 1 site on it. I did so many optimizations on php code and mysql queries, also server tweaks. Site has got 8000 average unique visitors.
There were problems sometimes but only high traffic times. And after a restart everything went ok. For 2 days VPS gives "resource outage" error and some services stops. hosting support says my VPS sometimes trying to use nearly 600mb RAM and suggest to move bigger plan which I can not afford at this time.

Please look at these values and configurations and make some recommendations:
TOP output:
Code:
01:01:19  up 29 min,  1 user,  load average: 15.04, 7.51, 5.12
179 processes: 172 sleeping, 4 running, 0 zombie, 3 stopped
CPU0 states:  67.0% user  32.0% system    0.0% nice   0.0% iowait   0.0% idle
CPU1 states:  70.0% user  29.0% system    0.0% nice   0.0% iowait   0.0% idle
CPU2 states:  77.0% user  22.0% system    0.0% nice   0.0% iowait   0.0% idle
CPU3 states:  78.0% user  21.0% system    0.0% nice   0.0% iowait   0.0% idle
Mem:  6197856k av, 6181756k used,   16100k free,       0k shrd,  441032k buff
      3849124k active,            1737780k inactive
Swap: 8193140k av, 3305044k used, 4888096k free                 1103116k cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
14880 root       8   0  5996 5996  5880 S    99.9  0.0   0:15   3 httpd
28660 mysql      9   0 27304  26M  2420 S    42.1  0.4   3:23   1 mysqld
23554 root      17   0  1024 1024   748 R     3.7  0.0   0:10   2 top
27813 root      11   0  5496 5496  1256 D     2.4  0.0   0:00   0 mrtg
27938 root       9   0  3400 3400  1416 D     0.3  0.0   0:00   0 cpbackup
28192 root       9   0  3340 3340  2148 S     0.3  0.0   0:00   1 dcpumon
 1792 mailman    9   0  4680 4680  1892 S     0.1  0.0   0:00   1 python
    1 root       9   0   480  480   432 S     0.0  0.0   0:00   0 init
23072 root       9   0   548  548   468 S     0.0  0.0   0:00   1 syslogd
23458 named      9   0  2900 2896  2144 S     0.0  0.0   0:00   0 named
24032 root       9   0  1492 1492  1356 S     0.0  0.0   0:00   0 sshd
24544 root       9   0   840  840   696 S     0.0  0.0   0:00   2 xinetd
25600 root       9   0  7820 7820  1492 S     0.0  0.1   0:00   1 chkservd
httpd.conf some variables:
Code:
Timeout 50

KeepAlive Off

MaxKeepAliveRequests 120
KeepAliveTimeout 10

MinSpareServers 8
MaxSpareServers 13

StartServers 10

MaxClients 250
MaxRequestsPerChild 50
MY.CNF:
Code:
[mysqld]
set-variable = max_connections=500
safe-show-database
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
read_buffer_size=2M
max_connect_errors=10
log-slow-queries = /var/log/sql_slow.log
long_query_time = 5
#log=/var/log/mysqld.log
[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=32M
sort_buffer=32M
read_buffer=16M
write_buffer=16M

 

 

 

 

Top