[求助]!!!请教关于Apache吃资源的分析
zxxz79
|
1#
zxxz79 发表于 2007-07-15 12:09
[求助]!!!请教关于Apache吃资源的分析
架构是 squid2.6- apache2+php4 -oracle9i
发现web狂吃内存cpu,连swap也不放过 翻了14页的精华帖子又搜索都没找到关于高负载时分析方面的文章 遇到高负载的时候可以通过什么途径查到是由什么那个程序页面访问引起的吗?
[Copy to clipboard] [ - ]
CODE:
top - 18:39:20 up 58 days, 18:05, 2 users, load average: 4.31, 4.09, 3.67
Tasks: 95 total, 3 running, 92 sleeping, 0 stopped, 0 zombie Cpu0 : 11.6% us, 88.4% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si Cpu1 : 1.7% us, 98.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si Cpu2 : 0.3% us, 99.7% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si Cpu3 : 0.0% us, 100.0% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si Mem: 4148472k total, 4132636k used, 15836k free, 5336k buffers Swap: 4192956k total, 4065316k used, 127640k free, 23760k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 14365 www 25 0 215m 32m 5208 S 100 0.8 474:13.21 httpd 14529 www 25 0 672m 230m 5220 S 100 5.7 215:39.31 httpd 15016 www 25 0 510m 448m 5240 S 100 11.1 14:47.97 httpd 14525 www 25 0 517m 140m 5220 R 88 3.5 273:02.09 httpd 15028 www 16 0 543m 483m 5220 S 3 11.9 2:11.56 httpd 15403 www 16 0 60840 45m 5200 S 3 1.1 0:06.23 httpd 15009 www 16 0 537m 472m 5224 S 2 11.7 2:07.71 httpd 15239 www 15 0 212m 198m 5216 S 1 4.9 0:39.03 httpd 15301 www 15 0 211m 197m 5244 S 1 4.9 0:37.62 httpd 15402 www 16 0 60232 44m 5184 S 1 1.1 0:06.55 httpd 15401 www 15 0 62372 46m 5180 S 1 1.2 0:06.39 httpd 15256 www 15 0 215m 201m 5220 S 0 5.0 0:38.43 httpd 15462 root 16 0 7724 2556 2080 R 0 0.1 0:00.11 sshd [root@www3 ~]# ps aux|grep httpd root 14333 0.0 0.0 19256 3860 ? Ss 09:30 0:04 /usr/local/apache2/bin/httpd -k start www 14343 0.1 0.7 220556 30208 ? S 09:30 0:40 /usr/local/apache2/bin/httpd -k start www 14349 0.1 0.7 222148 31408 ? S 09:30 0:41 /usr/local/apache2/bin/httpd -k start www 14360 0.1 0.7 233928 31968 ? S 09:30 0:43 /usr/local/apache2/bin/httpd -k start www 14364 0.1 0.6 214880 28044 ? S 09:30 0:39 /usr/local/apache2/bin/httpd -k start www 14365 86.3 0.8 220952 33632 ? R 09:30 474:44 /usr/local/apache2/bin/httpd -k start www 14367 0.1 0.7 224352 30812 ? S 09:30 0:40 /usr/local/apache2/bin/httpd -k start www 14368 0.1 0.7 229340 31960 ? S 09:30 0:41 /usr/local/apache2/bin/httpd -k start www 14376 0.1 0.7 222596 33096 ? S 09:31 0:41 /usr/local/apache2/bin/httpd -k start www 14494 0.0 0.8 89384 33964 ? S 10:21 0:12 /usr/local/apache2/bin/httpd -k start www 14521 0.0 0.1 25452 6080 ? S 10:46 0:00 /usr/local/apache2/bin/httpd -k start www 14523 0.0 0.1 24548 6080 ? S 10:46 0:00 /usr/local/apache2/bin/httpd -k start www 14524 0.5 5.3 679100 222900 ? S 10:46 2:46 /usr/local/apache2/bin/httpd -k start www 14525 57.7 3.4 529448 141780 ? S 10:46 273:30 /usr/local/apache2/bin/httpd -k start www 14527 0.0 0.1 22704 5908 ? S 10:46 0:00 /usr/local/apache2/bin/httpd -k start www 14529 45.6 5.6 688508 234832 ? S 10:46 216:11 /usr/local/apache2/bin/httpd -k start www 14530 0.0 0.1 23564 5992 ? S 10:46 0:00 /usr/local/apache2/bin/httpd -k start www 14554 0.5 5.4 662024 227196 ? S 10:51 2:45 /usr/local/apache2/bin/httpd -k start www 14555 0.4 3.1 515564 131148 ? S 10:54 1:55 /usr/local/apache2/bin/httpd -k start www 14721 0.1 1.6 196332 69236 ? S 13:05 0:33 /usr/local/apache2/bin/httpd -k start www 14924 0.1 1.4 169188 62048 ? S 14:08 0:31 /usr/local/apache2/bin/httpd -k start www 14925 0.1 1.4 160372 62092 ? S 14:13 0:27 /usr/local/apache2/bin/httpd -k start www 14926 0.1 1.1 141792 48640 ? S 14:17 0:22 /usr/local/apache2/bin/httpd -k start www 14984 0.0 0.1 22340 6668 ? S 15:06 0:00 /usr/local/apache2/bin/httpd -k start www 15009 1.0 11.6 552888 482968 ? S 15:20 2:08 /usr/local/apache2/bin/httpd -k start www 15016 7.6 11.0 522376 458776 ? S 15:20 15:19 /usr/local/apache2/bin/httpd -k start www 15028 1.1 11.9 558236 496952 ? S 15:20 2:11 /usr/local/apache2/bin/httpd -k start www 15140 0.8 6.5 309592 270540 ? S 16:28 1:04 /usr/local/apache2/bin/httpd -k start www 15239 0.8 4.9 220784 206096 ? S 17:23 0:39 /usr/local/apache2/bin/httpd -k start www 15251 0.8 4.8 215752 200992 ? S 17:23 0:38 /usr/local/apache2/bin/httpd -k start www 15256 0.8 5.0 222456 207888 ? S 17:23 0:38 /usr/local/apache2/bin/httpd -k start www 15301 0.8 4.9 218656 204180 ? S 17:25 0:37 /usr/local/apache2/bin/httpd -k start www 15401 0.8 1.2 65116 50492 ? S 18:25 0:06 /usr/local/apache2/bin/httpd -k start www 15402 0.8 1.1 61280 46728 ? S 18:26 0:06 /usr/local/apache2/bin/httpd -k start www 15403 0.8 1.1 62472 47844 ? S 18:26 0:06 /usr/local/apache2/bin/httpd -k start 系统日志还报了这些错误,杀掉吃cpu跟内存的进程后恢复正常。 Jul 14 18:46:53 www3 kernel: oom-killer: gfp_mask=0xd0 Jul 14 18:46:53 www3 kernel: Mem-info: Jul 14 18:46:53 www3 kernel: DMA per-cpu: Jul 14 18:46:53 www3 kernel: cpu 0 hot: low 2, high 6, batch 1 Jul 14 18:46:53 www3 kernel: cpu 0 cold: low 0, high 2, batch 1 Jul 14 18:46:53 www3 kernel: cpu 1 hot: low 2, high 6, batch 1 Jul 14 18:46:53 www3 kernel: cpu 1 cold: low 0, high 2, batch 1 Jul 14 18:46:53 www3 kernel: cpu 2 hot: low 2, high 6, batch 1 Jul 14 18:46:53 www3 kernel: cpu 2 cold: low 0, high 2, batch 1 Jul 14 18:46:53 www3 kernel: cpu 3 hot: low 2, high 6, batch 1 Jul 14 18:46:53 www3 kernel: cpu 3 cold: low 0, high 2, batch 1 Jul 14 18:46:53 www3 kernel: Normal per-cpu: Jul 14 18:46:53 www3 kernel: cpu 0 hot: low 32, high 96, batch 16 Jul 14 18:47:08 www3 kernel: cpu 0 cold: low 0, high 32, batch 16 Jul 14 18:47:09 www3 kernel: cpu 1 hot: low 32, high 96, batch 16 Jul 14 18:47:09 www3 kernel: cpu 1 cold: low 0, high 32, batch 16 Jul 14 18:47:09 www3 kernel: cpu 2 hot: low 32, high 96, batch 16 Jul 14 18:47:09 www3 kernel: cpu 2 cold: low 0, high 32, batch 16 Jul 14 18:47:09 www3 kernel: cpu 3 hot: low 32, high 96, batch 16 Jul 14 18:47:10 www3 kernel: cpu 3 cold: low 0, high 32, batch 16 Jul 14 18:47:10 www3 kernel: HighMem per-cpu: Jul 14 18:47:10 www3 kernel: cpu 0 hot: low 32, high 96, batch 16 Jul 14 18:47:10 www3 kernel: cpu 0 cold: low 0, high 32, batch 16 Jul 14 18:47:10 www3 kernel: cpu 1 hot: low 32, high 96, batch 16 Jul 14 18:47:10 www3 kernel: cpu 1 cold: low 0, high 32, batch 16 Jul 14 18:47:10 www3 kernel: cpu 2 hot: low 32, high 96, batch 16 Jul 14 18:47:10 www3 kernel: cpu 2 cold: low 0, high 32, batch 16 Jul 14 18:47:10 www3 kernel: cpu 3 hot: low 32, high 96, batch 16 Jul 14 18:47:10 www3 kernel: cpu 3 cold: low 0, high 32, batch 16 Jul 14 18:47:10 www3 kernel: Jul 14 18:47:10 www3 kernel: Free pages: 14596kB (1152kB HighMem) Jul 14 18:47:10 www3 kernel: Active:557488 inactive:459240 dirty:0 writeback:0 unstable:0 free:3649 slab:6753 mapped:1015154 pagetables:5891 Jul 14 18:47:10 www3 kernel: DMA free:12564kB min:16kB low:32kB high:48kB active:0kB inactive:0kB present:16384kB pages_scanned:3068 all_unreclaimable? yes Jul 14 18:47:10 www3 kernel: protections[]: 0 0 0 Jul 14 18:47:10 www3 kernel: Normal free:880kB min:928kB low:1856kB high:2784kB active:430452kB inactive:383640kB present:901120kB pages_scanned:1165395 all_unreclaimable? yes Jul 14 18:47:11 www3 kernel: protections[]: 0 0 0 Jul 14 18:47:11 www3 kernel: HighMem free:1152kB min:512kB low:1024kB high:1536kB active:1799500kB inactive:1453320kB present:4063232kB pages_scanned:3828 all_unreclaimable? no Jul 14 18:47:11 www3 kernel: protections[]: 0 0 0 Jul 14 18:47:11 www3 kernel: DMA: 5*4kB 4*8kB 4*16kB 3*32kB 3*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 2*4096kB = 12564kB Jul 14 18:47:11 www3 kernel: Normal: 0*4kB 0*8kB 1*16kB 1*32kB 13*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 880kB Jul 14 18:47:11 www3 kernel: HighMem: 154*4kB 3*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 1152kB Jul 14 18:47:11 www3 kernel: Swap cache: add 4256821, delete 4256082, find 2429623/2648194, race 0+33 Jul 14 18:47:11 www3 kernel: 0 bounce buffer pages Jul 14 18:47:11 www3 kernel: Free swap: 0kB Jul 14 18:47:11 www3 kernel: 1245184 pages of RAM Jul 14 18:47:11 www3 kernel: 818944 pages of HIGHMEM Jul 14 18:47:11 www3 kernel: 208066 reserved pages Jul 14 18:47:11 www3 kernel: 65951 pages shared Jul 14 18:47:11 www3 kernel: 739 pages swap cached Jul 14 18:47:11 www3 kernel: Out of Memory: Killed process 15140 (httpd). |