免费注册 查看新帖 |

Chinaunix

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

网站做压力测试,服务器内存消耗问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-25 11:00 |只看该作者 |倒序浏览
10可用积分
当压力测试并发达1000时,内存基本消耗完,并发数再加上去就会死机,数据库服务器压力不大,有使用文件缓存,数据量比较大,有xcache
环境:
PHP Version 5.2.6
  
System         Linux bogon 2.6.18-92.el5xen #1 SMP Tue Apr 29 13:31:30 EDT 2008 x86_64
Build Date         Aug 5 2009 17:51:16
Configure Command './configure' '--prefix=/usr/local/php''--with-apxs2=/usr/local/apache2/bin/apxs''--with-mysqli=/usr/local/mysql/bin/mysql_config''--with-mysql=/usr/local/mysql'
Server API         Apache 2.0 Handler
Virtual Directory Support         enabled
Configuration File (php.ini) Path         /usr/local/php/lib
Loaded Configuration File         /usr/local/php/lib/php.ini
PHP API         20041225
PHP Extension         20060613
Zend Extension         220060519
Debug Build         no
Thread Safety         enabled
Zend Memory Manager         enabled
IPv6 Support         enabled
Registered PHP Streams         php, file, data, http, ftp
Registered Stream Socket Transports         tcp, udp, unix, udg
Registered Stream Filters string.rot13, string.toupper, string.tolower,string.strip_tags, convert.*, consumed, convert.iconv.*

PS:memory_get_usage();每个进程的内存是379816左右,
     服务器内存4G,初始值大概1G

论坛徽章:
0
2 [报告]
发表于 2009-08-25 11:23 |只看该作者
服务器和数据库是两台机器,有文件缓存,1000次并发数据库读取为50-200之间,数据库压力不大

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
3 [报告]
发表于 2009-08-25 13:24 |只看该作者
从测试机,到服务器到数据库的觉体结构是怎么样的?

先看看纯静态并发可以到多少。

论坛徽章:
0
4 [报告]
发表于 2009-08-25 13:35 |只看该作者
原帖由 HonestQiao 于 2009-8-25 13:24 发表
从测试机,到服务器到数据库的觉体结构是怎么样的?

先看看纯静态并发可以到多少。

你说结构?具体指什么?

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
5 [报告]
发表于 2009-08-25 13:40 |只看该作者
网络结构。

另外注意观察,这个时侯的流量情况,以及helloworld的情况。

论坛徽章:
0
6 [报告]
发表于 2009-08-25 13:46 |只看该作者
服务器是网通的,测试机是电信
网络结构所造成的影响应该是访问响应速度,而不是内存吧?

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
7 [报告]
发表于 2009-08-25 13:49 |只看该作者
访问响应速度也会有一定影响的。

如果访问不能马上结束,势必造成请求堆积,不能马上释放内存,最后内存也会急剧消耗的。

你先看看纯静态额helloworld的情况吧。

论坛徽章:
0
8 [报告]
发表于 2009-08-25 13:53 |只看该作者
helloworld
内存:75496

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
9 [报告]
发表于 2009-08-25 13:58 |只看该作者
其他的数据呢?
你如果用ab测试的,ab也有报表的。

论坛徽章:
0
10 [报告]
发表于 2009-08-25 14:05 |只看该作者
E:\xampp\apache\bin>ab -n 10 -c 10 http://www.xxx.com/test2.php;
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.xxx.com (be patient).....done


Server Software:        Apache/2.2.6
Server Hostname:        www.xxx.com
Server Port:            80

Document Path:          /test2.php;
Document Length:        291 bytes

Concurrency Level:      10
Time taken for tests:   0.125 seconds
Complete requests:      10
Failed requests:        0
Write errors:           0
Non-2xx responses:      10
Total transferred:      4780 bytes
HTML transferred:       2910 bytes
Requests per second:    80.00 [#/sec] (mean)
Time per request:       125.000 [ms] (mean)
Time per request:       12.500 [ms] (mean, across all concurrent requests)
Transfer rate:          37.34 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   11   7.5     16      16
Processing:    16   48  29.0     47      94
Waiting:       16   48  29.0     47      94
Total:         16   59  30.2     63     109

Percentage of the requests served within a certain time (ms)
  50%     63
  66%     78
  75%     78
  80%     94
  90%    109
  95%    109
  98%    109
  99%    109
100%    109 (longest request)

[ 本帖最后由 cccxxx 于 2009-8-25 14:15 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP