Hello
A friend of mine is running a LAMP application that's on its knees, and would like to know what to do about it: Either make changes to the PHP or MySQL code, or order a faster server.
Here's what top says:
top - 21:20:49 up 3:35, 1 user, load average: 61.88, 51.08, 74.30
Tasks: 476 total, 7 running, 467 sleeping, 0 stopped, 2 zombie
Cpu(s): 78.8% us, 18.7% sy, 0.0% ni, 0.7% id, 0.3% wa, 0.5% hi, 1.0% si
Mem: 1015484k total, 993344k used, 22140k free, 76920k buffers
Swap: 514040k total, 101032k used, 413008k free, 208496k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
10685 ze-card 19 19 984 736 724 R N 93.3 0.0 5671m webalizer
32072 nobody 9 0 16932 15M 12156 S 6.0 0.3 0:01 httpd
32196 nobody 9 0 16224 14M 12144 S 3.5 0.3 0:01 httpd
1868 nobody 9 0 16284 14M 12620 S 3.1 0.3 0:00 httpd
2136 nobody 9 0 16080 14M 12164 S 2.5 0.3 0:00 httpd
32205 nobody 9 0 16300 14M 12136 S 2.3 0.3 0:00 httpd
32231 nobody 9 0 16316 14M 12172 S 2.3 0.3 0:00 httpd
32124 nobody 9 0 16620 14M 12184 S 1.9 0.3 0:01 httpd
Here's what vmstat says:
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
9 0 0 55588 87548 329824 0 0 166 292 369 896 69 17 5 9
8 0 0 49116 87572 330204 0 0 102 192 681 1686 71 25 4 0
5 0 0 45632 87584 330240 0 0 16 1298 765 1910 77 21 1 0
28 0 0 43072 87592 330296 0 0 8 86 737 2098 80 19 1 0
49 0 0 40676 87600 330384 0 0 32 1302 808 2139 76 22 3 1
52 0 0 40320 87628 330504 0 0 56 1078 855 2163 80 19 1 0
51 3 0 39904 87636 330560 0 0 32 244 822 1795 80 21 0 0
12 1 0 37816 87668 331280 0 0 342 1424 1121 2606 75 22 0 2
36 0 0 36708 87704 331648 0 0 150 186 798 2353 72 22 3 2
36 0 0 35660 87712 331784 0 0 38 24 896 1789 80 19 0 0
Can you tell what's wrong?
Thank you for any tip.