大家的CPU有这么多0吗?
vlike
|
1#
vlike 发表于 2007-10-21 01:07
大家的CPU有这么多0吗?
这种情况正常吗?
我的网站每天也就1万IP左右,PV50万左右, 基本上全天的CPU都是跑得满满的 系统Freebsd 5.4,CPU 奔4 3.0,内存2G,PHP5.2,MySql4.1.x 前端装了Squid2.5,后端分别开了Zeus和lighttpd,现在输入网址,到显示网页,空白时间平均3秒 如果不开Squid,网站根本访问不了,Lighttpd是专门用来给论坛用的。 如果用Lighttpd提供作全站的Web服务,基本2分钟内就出现500错误, 如果用Zues作全站Web服务,网站基本上打不开。 我一直认为不知道是不是磁盘的读写性能太差,按理说,CPU不应该长期爆满啊。。。。。我只是开个论坛而已, 其它基本上是静态的文件。 请大家帮我看看,分析一下 当前连接数是: #netstat -an | wc -l 1459 ---------------------------------------- 当前流量 Interface Traffic Peak Total lo0 in 876.679 KB/s 898.407 KB/s 1.483 GB out 876.679 KB/s 898.407 KB/s 1.483 GB vr0 in 29.830 KB/s 29.830 KB/s 68.420 MB out 526.347 KB/s 643.840 KB/s 876.544 MB --------------------------------------------- 以下是运行TOP结果 last pid: 1246; load averages: 20.60, 21.19, 17.08 up 0+00:28:10 00:54:39 323 processes: 13 running, 310 sleeping CPU states: 89.1% user, 0.0% nice, 8.9% system, 1.9% interrupt, 0.0% idle Mem: 642M Active, 861M Inact, 220M Wired, 32K Cache, 112M Buf, 271M Free Swap: 4053M Total, 4053M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 976 nobody 115 -2 105M 13884K RUN 0:22 3.27% 3.27% php.fcgi 705 nobody 115 -2 105M 12992K RUN 0:43 3.17% 3.17% php.fcgi 980 nobody 115 -2 106M 14396K RUN 0:22 3.12% 3.12% php.fcgi 971 nobody 115 -2 106M 14076K RUN 0:22 3.12% 3.12% php.fcgi 973 nobody 115 -2 106M 14284K RUN 0:22 3.08% 3.08% php.fcgi 968 nobody 4 -2 104M 12260K accept 0:23 3.03% 3.03% php.fcgi 969 nobody 114 -2 105M 13976K RUN 0:23 2.88% 2.88% php.fcgi 987 nobody 113 -2 105M 13892K RUN 0:22 2.69% 2.69% php.fcgi 977 nobody 114 -2 106M 14476K RUN 0:22 2.64% 2.64% php.fcgi 988 nobody 4 -2 104M 12272K accept 0:19 2.59% 2.59% php.fcgi 982 nobody 113 -2 105M 14160K RUN 0:21 2.39% 2.39% php.fcgi 983 nobody 113 -2 106M 14384K RUN 0:22 2.34% 2.34% php.fcgi 989 nobody 4 -2 104M 12308K accept 0:21 2.29% 2.29% php.fcgi 963 nobody 111 0 46516K 45960K RUN 0:17 2.15% 2.15% squid 996 nobody 4 -2 104M 12256K accept 0:22 1.90% 1.90% php.fcgi 740 nobody 109 -2 104M 12512K select 0:33 1.76% 1.76% php.fcgi 1000 nobody 4 -2 103M 12056K accept 0:20 1.37% 1.37% php.fcgi 997 nobody 4 -2 104M 12304K accept 0:20 0.98% 0.98% php.fcgi 998 nobody 4 -2 104M 12784K accept 0:19 0.98% 0.98% php.fcgi 1004 nobody 4 -2 104M 12304K accept 0:19 0.98% 0.98% php.fcgi 1009 nobody 4 -2 104M 12292K accept 0:16 0.98% 0.98% php.fcgi 1055 nobody 4 -2 104M 12292K accept 0:13 0.98% 0.98% php.fcgi 1008 nobody 4 -2 104M 12340K accept 0:18 0.93% 0.93% php.fcgi 1007 nobody 4 -2 104M 12340K accept 0:17 0.93% 0.93% php.fcgi 1006 nobody 4 -2 104M 12832K accept 0:21 0.83% 0.83% php.fcgi 1189 nobody 4 -2 103M 11792K accept 0:05 0.78% 0.78% php.fcgi 1191 nobody 4 -2 104M 12240K accept 0:05 0.78% 0.78% php.fcgi 1003 nobody 4 -2 104M 12756K accept 0:19 0.68% 0.68% php.fcgi 1194 nobody 4 -2 104M 12324K accept 0:05 0.54% 0.54% php.fcgi 1197 nobody 4 -2 104M 12296K accept 0:05 0.54% 0.54% php.fcgi 1196 nobody 4 -2 104M 12228K accept 0:05 0.54% 0.54% php.fcgi 407 root 4 0 104M 11896K accept 0:06 0.20% 0.20% php.fcgi 667 root 99 -2 12024K 11180K RUN 0:24 0.15% 0.15% zeus.web 409 root 4 0 104M 11520K accept 0:06 0.15% 0.15% php.fcgi 408 root 4 0 104M 11512K accept 0:06 0.10% 0.10% php.fcgi 1143 nobody 4 -2 104M 12336K accept 0:02 0.10% 0.10% php.fcgi ------------------------------------------------ 以下是运行iostat结果 tty ad4 ad6 cpu tin tout KB/t tps MB/s KB/t tps MB/s us ni sy in id 1 170 34.30 34 1.14 12.35 7 0.08 79 0 10 2 8 0 179 0.00 0 0.00 0.00 0 0.00 93 0 5 2 0 0 59 11.20 5 0.05 0.00 0 0.00 88 0 9 4 0 0 59 16.34 52 0.84 2.00 1 0.00 88 0 10 2 0 0 59 13.88 13 0.17 2.00 1 0.00 82 0 13 5 0 0 59 15.95 22 0.34 0.00 0 0.00 84 0 14 2 0 0 59 23.15 10 0.22 0.00 0 0.00 83 0 14 3 0 0 59 64.00 1 0.06 0.00 0 0.00 89 0 9 2 0 0 59 34.86 7 0.24 0.00 0 0.00 88 0 11 2 0 0 59 18.89 9 0.16 0.00 0 0.00 86 0 11 3 0 0 59 40.30 10 0.39 0.00 0 0.00 91 0 5 4 0 0 59 49.50 4 0.19 0.00 0 0.00 84 0 13 2 0 0 59 46.80 5 0.23 0.00 0 0.00 92 0 6 2 0 0 59 16.25 10 0.16 0.00 0 0.00 78 0 18 4 0 0 59 12.08 6 0.07 0.00 0 0.00 88 0 9 2 0 0 59 26.94 8 0.21 0.00 0 0.00 86 0 12 2 0 0 59 32.38 8 0.25 0.00 0 0.00 89 0 10 1 0 0 59 24.73 11 0.26 16.00 1 0.02 86 0 12 2 0 0 59 16.00 12 0.19 0.00 0 0.00 87 0 9 4 0 0 59 14.00 3 0.04 0.00 0 0.00 91 0 7 2 0 --------------------------------------------------- 以下是运行vmstat结果 procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad4 ad6 in sy cs us sy id 28 1 0 7317552 81800 4275 1 1 0 4364 10 0 0 2060 14171 3450 80 13 8 26 1 0 7317616 81332 5055 4 2 2 5048 0 91 0 1877 12460 3143 85 15 0 27 2 0 7319896 79348 6065 0 0 0 5678 0 8 0 2220 13301 4027 85 15 0 22 1 0 7321584 77048 4029 3 6 0 3520 0 17 0 1417 9099 3372 85 15 0 23 1 0 7318696 80212 5088 4 5 0 6054 0 15 1 2798 9461 5085 85 15 0 12 1 0 7227852 76936 4946 4 2 0 4195 0 3 0 1642 7671 2527 93 7 0 40 1 0 7213460 90876 4281 0 1 0 7918 0 5 1 1996 14874 3367 85 15 0 46 1 0 7213860 89148 5033 0 0 0 4701 0 8 1 1506 11294 2956 90 10 0 34 2 0 7219056 84252 4696 0 0 0 3621 0 5 1 2022 18710 4321 91 9 0 39 1 0 7220168 81512 3948 8 5 0 3414 0 28 0 3374 12219 4417 83 17 0 39 1 0 7215968 86572 3693 0 0 0 5048 0 6 0 2587 11098 5090 87 13 0 41 1 0 7222200 81424 3914 0 0 0 2733 0 4 0 2716 27871 3801 85 15 0 34 1 0 7227640 75540 4367 0 0 0 2947 0 2 0 2466 15370 4396 83 17 0 38 1 0 7223576 79568 3932 4 4 0 5120 0 17 1 3699 10037 4637 89 11 0 37 1 0 7223624 78400 4566 8 4 0 4430 0 12 0 2901 9892 4827 85 15 0 35 1 0 6904888 108424 5562 0 0 0 13166 0 4 0 2796 9137 3774 88 12 0 38 2 0 6904324 108692 4120 8 4 0 4299 0 4 30 2637 11383 3776 90 10 0 37 2 0 6912340 100240 4916 8 4 0 2962 0 113 0 2961 11697 4566 84 16 0 33 1 0 6912100 100244 4270 3 0 0 4381 0 12 180 3003 15430 5972 81 19 0 36 1 0 6906340 105960 4772 0 0 0 6344 0 1 0 2014 10024 3426 85 15 0 |