免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1721 | 回复: 5
打印 上一主题 下一主题

[Web] web 服务器性能问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-01-09 11:34 |只看该作者 |倒序浏览
我家用的是HP Proliant DL380 G4
内存4G  两个Intel(R) Xeon(TM) CPU 3.00GHz
系统是redhat as4 (2.6.9 )    Apache/2.0.58    PHP 4.4.2   Zend Engine v1.3.0,   
Zend Extension Manager v1.0.10,
Zend Optimizer v3.0.1
装上apache后用ab测试性能后发现每秒 才能响应30个左右的php动态页面请求.400个左右的静态页面请求
感觉太少.想知道是硬件的限制吗?
(启用的其他服务有:mysql  samba qmail 但都没怎么用)
我配置文件httpd.conf里设置如下:
<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
MaxClients         256
MaxRequestsPerChild  4028


top命令显示如下:
top - 11:31:03 up 71 days,  2:51,  2 users,  load average: 0.13, 0.66, 1.13
Tasks: 107 total,   1 running, 106 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2% us,  0.1% sy,  0.0% ni, 99.6% id,  0.2% wa,  0.0% hi,  0.0% si
Mem:   3115284k total,  2741280k used,   374004k free,   105392k buffers
Swap:  3068372k total,      144k used,  3068228k free,  2440788k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
8278 vpopmail  16   0 16604 9416 2592 S  0.7  0.3   0:00.33 httpd              
8355 root      16   0  2000  952  748 R  0.3  0.0   0:00.06 top               
    1 root      16   0  2584  556  476 S  0.0  0.0   0:00.87 init               
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.69 migration/0        
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0        
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.37 migration/1        
    5 root      34  19     0    0    0 S  0.0  0.0   0:00.01 ksoftirqd/1        
    6 root      RT   0     0    0    0 S  0.0  0.0   0:00.27 migration/2        
    7 root      34  19     0    0    0 S  0.0  0.0   0:00.02 ksoftirqd/2        
    8 root      RT   0     0    0    0 S  0.0  0.0   0:00.40 migration/3        
    9 root      34  19     0    0    0 S  0.0  0.0   0:00.01 ksoftirqd/3        
   10 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 events/0           
   11 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 events/1           
   12 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 events/2           
   13 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 events/3           
   14 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 khelper            
   15 root      15 -10     0    0    0 S  0.0  0.0   0:00.00 kacpid            
   45 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 kblockd/0         
   46 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 kblockd/1         
   47 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 kblockd/2

[ 本帖最后由 lianbinjie 于 2007-1-9 17:53 编辑 ]

论坛徽章:
1
金牛座
日期:2014-05-29 15:55:47
2 [报告]
发表于 2007-01-09 14:12 |只看该作者
apache什么版本?参数是什么?都不说。

论坛徽章:
0
3 [报告]
发表于 2007-01-10 09:58 |只看该作者
我的pc机



  1. Document Path:          /ds.html
  2. Document Length:        17089 bytes

  3. Concurrency Level:      1000
  4. Time taken for tests:   12.14643 seconds
  5. Complete requests:      10000
  6. Failed requests:        0
  7. Write errors:           0
  8. Total transferred:      174433538 bytes
  9. HTML transferred:       172048994 bytes
  10. Requests per second:    832.32 [#/sec] (mean)
  11. Time per request:       1201.464 [ms] (mean)
  12. Time per request:       1.201 [ms] (mean, across all concurrent requests)
  13. Transfer rate:          14178.12 [Kbytes/sec] received


复制代码

[ 本帖最后由 dajun 于 2007-1-10 10:01 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2007-01-11 10:40 |只看该作者
不会吧.兄弟.你的PC什么配置.
怎么比我的服务器还强呢?
每秒钟响应800多请求呢?
能帮兄弟我分析一下吗?
你测试的哪个 'ds.html'页面里内容多吗?
我的会不会是因为页面里有图片 造成的?
谢谢啦 大哥.帮帮小的

论坛徽章:
0
5 [报告]
发表于 2007-01-11 16:26 |只看该作者
才不到20k,^_^
ab不下载图片的


再来个80多k的吧


  1. Document Path:          /perl-magick.html
  2. Document Length:        80914 bytes

  3. Concurrency Level:      1000
  4. Time taken for tests:   15.576267 seconds
  5. Complete requests:      10000
  6. Failed requests:        0
  7. Write errors:           0
  8. Total transferred:      817713085 bytes
  9. HTML transferred:       815319859 bytes
  10. Requests per second:    642.00 [#/sec] (mean)
  11. Time per request:       1557.627 [ms] (mean)
  12. Time per request:       1.558 [ms] (mean, across all concurrent requests)
  13. Transfer rate:          51266.90 [Kbytes/sec] received

  14. Connection Times (ms)
  15.               min  mean[+/-sd] median   max
  16. Connect:        1  239 1140.9     21    9008
  17. Processing:    31  357 567.0    275    8755
  18. Waiting:        8  258 569.9    179    8684
  19. Total:        109  596 1530.5    317   15452

复制代码


赛扬2。4g+512M内存


ab和apache在一个机器上可能要快些
我笔记本上的虚拟机186m的内存都能搞到1000多每秒,可能是笔记本的pm的cpu缓存大些,
但是你的服务器应该是更强的

论坛徽章:
0
6 [报告]
发表于 2007-01-11 16:43 |只看该作者
你尝试一下自己编译apache2,你不会是远程ab的吧?那样会收到网络的影响的

还有你的4g内存也只显示了3g,redhat as4好像有个hugemem的内核,可以试试,我没用过服务器
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP