crashing apache on high swap memory

Kestas

Verified User
Joined
Feb 17, 2006
Messages
15
Hello,

Have big problem

I have CentOS
512 ram
1 GB swap i think default
Load after reboot about 0.20 0.50

but ram is loading, and then ram full, starting loading SWAP memory after some time, then swap memory full the pc crashing (only ping working) no direct adimn or ssh working i think its cause big load abnout 90 or more even

its taking about 40 mins to crachs

i've have default direct admin
and tried to instal ZEND and then its stared, how can i clear my apache and php ?
from php removed last ZEND lines
./build clear user too
dont know what to do

sorry, have probs with en :)
thanks in advance with help


after reboot:

Code:
top - 20:59:24 up 9 min,  1 user,  load average: 0.52, 0.55, 0.34
Tasks: 209 total,   1 running, 208 sleeping,   0 stopped,   0 zombie
Cpu(s): 21.3% us,  3.0% sy,  0.0% ni, 74.8% id,  0.7% wa,  0.3% hi,  0.0% si
Mem:    499804k total,   473260k used,    26544k free,    12784k buffers
Swap:  1052248k total,        0k used,  1052248k free,   104960k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 2937 apache    15   0 27888  18m   9m S  4.7  3.8   0:02.08 httpd
 2908 apache    15   0 27560  17m   9m S  2.7  3.7   0:00.75 httpd
 3333 apache    15   0 25872  16m 9.9m S  2.7  3.3   0:00.14 httpd
 2997 mysql     16   0 94280  23m 1924 S  2.0  4.9   0:00.14 mysqld

php.ini atached
 

Attachments

Last edited:
top - 21:27:22 up 37 min, 1 user, load average: 0.49, 0.51, 0.47
Tasks: 211 total, 3 running, 208 sleeping, 0 stopped, 0 zombie
Cpu(s): 33.7% us, 2.8% sy, 0.0% ni, 61.9% id, 1.2% wa, 0.3% hi, 0.0% si
Mem: 499804k total, 473236k used, 26568k free, 3140k buffers
Swap: 1052248k total, 56656k used, 995592k free, 58276k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4033 apache 15 0 26832 17m 9.9m S 6.5 3.6 0:01.99 httpd
4038 apache 15 0 26988 17m 10m S 4.4 3.7 0:04.56 httpd
3011 mysql 16 0 93764 28m 1792 S 3.7 5.7 0:00.99 mysqld
4699 apache 15 0 25420 16m 9.9m S 2.8 3.3 0:00.31 httpd
4324 apache 15 0 26964 17m 9.9m S 2.5 3.6 0:01.65 httpd
4700 apache 15 0 25416 16m 9.9m S 2.5 3.3 0:00.32 httpd
4034 apache 15 0 27120 17m 9m S 1.6 3.7 0:03.21 httpd
4004 apache 15 0 27512 18m 9m S 0.9 3.8 0:02.62 httpd
4048 apache 15 0 25456 16m 9.9m S 0.9 3.3 0:00.62 httpd
4702 apache 15 0 24804 15m 9.9m S 0.9 3.2 0:00.26 httpd
2637 mysql 17 0 93764 28m 1792 S 0.6 5.7 0:00.90 mysqld
3999 apache 15 0 26912 17m 9.9m S 0.6 3.5 0:02.43 httpd
4009 apache 15 0 27472 18m 10m S 0.6 3.8 0:03.64 httpd
4011 apache 16 0 27556 18m 9m S 0.6 3.8 0:04.08 httpd
4018 apache 15 0 27440 18m 9m S 0.6 3.7 0:03.67 httpd
4024 apache 16 0 27040 17m 9m S 0.6 3.6 0:01.98 httpd

after 37 min off uptime forking, but SWAP loading



UPDATE:

top - 21:31:40 up 41 min, 1 user, load average: 1.66, 0.87, 0.60
Tasks: 247 total, 1 running, 246 sleeping, 0 stopped, 0 zombie
Cpu(s): 36.7% us, 6.3% sy, 0.0% ni, 0.0% id, 56.7% wa, 0.3% hi, 0.0% si
Mem: 499804k total, 495304k used, 4500k free, 2652k buffers
Swap: 1052248k total, 118080k used, 934168k free, 52072k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4047 apache 15 0 27448 17m 9780 S 4.6 3.6 0:04.88 httpd
4510 apache 15 0 26624 16m 9648 S 4.6 3.4 0:00.96 httpd
4026 apache 15 0 26724 16m 9676 S 4.0 3.5 0:04.19 httpd
4701 apache 15 0 27084 17m 9680 S 3.3 3.6 0:01.41 httpd
4998 mysql 16 0 98936 19m 1644 S 3.3 3.9 0:00.10 mysqld
4030 apache 15 0 27024 17m 9696 S 2.7 3.5 0:03.39 httpd
4001 apache 15 0 26884 17m 9780 S 1.7 3.5 0:03.77 httpd
4027 apache 15 0 27256 17m 9780 S 1.7 3.6 0:02.85 httpd
4007 apache 15 0 26744 16m 9692 S 1.3 3.5 0:03.43 httpd
4710 apache 15 0 26528 16m 9636 S 1.3 3.4 0:00.19 httpd
4043 apache 15 0 27064 17m 9672 S 1.0 3.5 0:03.41 httpd
40 root 15 0 0 0 0 S 0.7 0.0 0:03.07 kswapd0
3015 mysql 15 0 98936 19m 1644 D 0.7 3.9 0:01.15 mysqld

UPDATE 2:

  • top - 18:07:50 up 1:35, 1 user, load average: 3.11, 2.33, 1.31
    Tasks: 232 total, 2 running, 214 sleeping, 0 stopped, 16 zombie
    Cpu(s): 11.3% us, 6.3% sy, 0.0% ni, 0.0% id, 82.3% wa, 0.0% hi, 0.0% si
    Mem: 499804k total, 360200k used, 139604k free, 2568k buffers
    Swap: 1052248k total, 217756k used, 834492k free, 54276k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    6320 apache 15 0 26432 18m 10m D 1.0 3.7 0:05.31 httpd
    6323 apache 15 0 27704 18m 10m D 1.0 3.8 0:03.41 httpd
    6326 apache 16 0 27288 17m 10m D 0.7 3.6 0:02.78 httpd
    6331 apache 15 0 27964 18m 10m D 0.7 3.7 0:04.01 httpd
    6332 apache 15 0 28152 18m 10m D 0.7 3.7 0:03.39 httpd
    6748 apache 15 0 26620 18m 10m D 0.7 3.7 0:01.57 httpd
    7019 apache 15 0 0 0 0 Z 0.7 0.0 0:01.45 httpd <defunct>
    7020 apache 15 0 0 0 0 Z 0.7 0.0 0:01.22 httpd <defunct>
    2934 mysql 16 0 79012 27m 1636 S 0.3 5.6 0:03.26 mysqld
 
Last edited:
one more.. sorry for flood realy need help


  • top - 19:54:36 up 1:18, 1 user, load average: 70.71, 20.21, 7.53
    Tasks: 786 total, 1 running, 785 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.7% us, 22.2% sy, 0.0% ni, 0.0% id, 76.8% wa, 0.3% hi, 0.0% si
    Mem: 499804k total, 497844k used, 1960k free, 984k buffers
    Swap: 1052248k total, 645620k used, 406628k free, 15044k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    40 root 15 0 0 0 0 D 3.6 0.0 0:10.21 kswapd0
    7301 apache 17 0 26240 3840 2368 D 2.3 0.8 0:00.16 httpd
    7674 apache 17 0 26168 5392 2344 D 2.3 1.1 0:00.12 httpd
    7617 apache 17 0 26172 4664 2344 D 1.7 0.9 0:00.08 httpd
    7305 apache 17 0 26260 3852 2368 D 1.3 0.8 0:00.15 httpd
    7502 apache 17 0 26168 5472 2344 D 1.3 1.1 0:00.07 httpd
    3536 root 17 0 3876 1264 664 R 1.0 0.3 0:09.95 top
    7465 apache 17 0 26168 3824 2340 D 1.0 0.8 0:00.05 httpd
    7515 apache 17 0 26168 5424 2344 D 1.0 1.1 0:00.06 httpd
    7550 apache 17 0 26168 4624 2344 D 1.0 0.9 0:00.08 httpd
    7302 apache 17 0 26240 3840 2368 D 0.7 0.8 0:00.09 httpd
    7466 apache 17 0 26168 3820 2340 D 0.7 0.8 0:00.05 httpd
    7590 apache 17 0 26168 4684 2344 D 0.7 0.9 0:00.09 httpd
    7599 apache 17 0 26028 4904 2344 D 0.7 1.0 0:00.05 httpd
    7618 apache 17 0 26168 4552 2344 D 0.7 0.9 0:00.04 httpd
    7640 apache 17 0 26168 5224 2344 D 0.7 1.0 0:00.04 httpd


 
if you using large amounts of swap you in trouble it will have a chain affect in that each process takes longer to complete its task and as a result it will swamp cpu and load averages go up.

either upgrade your ram or configure things such as mysql to use less memory so you not swapping.
 
I just want to add to what Chrysalis wrote that finding the reason for high memory usage isn't always easy.

But you're going to have to do it, or have someone do it.

You can start by optimizing mysql; there are examples on these forums.

Are you being DOSed? Getting a lot of spam?

512MB really isn't much for a shared server in today's envrionment.

Jeff
 
Back
Top