免费注册 查看新帖 |

Chinaunix

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

Apache ab压力测试与Mysql问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-06 18:14 |只看该作者 |倒序浏览
服务器硬件:两台IBM X3550 7978b1c,四核CPU:Xeon E5405,内存2G,两块146G的SAS硬盘组成RAID1。
两台操作系统都安装的Freebsd7.2,其中一台安装网站前台Apache、Php等软件(在外网),另外一台只这装了Mysql(不联外网)。
安装了网上商城系统(ecshop)
请问这样的硬件配置和网站需求,在各种条件都调试好的情况下,最多可以提供多少人的访问服务。

环境:
#cat httpd-mpm.conf
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    ServerLimit         1000
    MaxClients          1000
    MaxRequestsPerChild   5000
</IfModule>
# cat httpd-default.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
ServerTokens Full
HostnameLookups Off

# ab -c 200 -n 9000 http://www.abc.com/index.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.abc.com (be patient)
Completed 900 requests
Completed 1800 requests
Completed 2700 requests
Completed 3600 requests
Completed 4500 requests
Completed 5400 requests
Completed 6300 requests
Completed 7200 requests
Completed 8100 requests
Completed 9000 requests
Finished 9000 requests
Server Software:        Apache/2.2.11
Server Hostname:        www.abc.com
Server Port:            80
Document Path:          /index.php
Document Length:        495 bytes
Concurrency Level:      200
Time taken for tests:   74.897 seconds
Complete requests:      9000
Failed requests:        357
   (Connect: 0, Receive: 0, Length: 357, Exceptions: 0)
Write errors:           0
Total transferred:      6521202 bytes
HTML transferred:       4307559 bytes
Requests per second:    120.17 [#/sec] (mean)
Time per request:       1664.376 [ms] (mean)
Time per request:       8.322 [ms] (mean, across all concurrent requests)
Transfer rate:          85.03 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   50 345.6      1    3238
Processing:    44 1605 894.7   1438    9026
Waiting:       44 1567 885.7   1405    9026
Total:         44 1654 964.7   1450    9077
Percentage of the requests served within a certain time (ms)
  50%   1450
  66%   1814
  75%   2109
  80%   2305
  90%   2881
  95%   3467
  98%   4406
  99%   4752
100%   9077 (longest request)

此时数据库已经连接不上了,网页出错如下:
MySQL server error report:Array ( [0] => Array ( [message] => MySQL Query Error ) [1] => Array ( [sql] => INSERT INTO `ecshop`.`ecs_sessions` (sesskey, expiry, ip, data) VALUES ('9c3986f365211a989058e4b491594adf', '1249112213', '117.28.144.179', 'a:0:{}') ) [2] => Array ( [error] => The table 'ecs_sessions' is full ) [3] => Array ( [errno] => 1114 ) )
只能重新启动mysql服务进程才可以正常访问。
#cat my.cnf
# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 1024M
max_allowed_packet = 2M
max_connections = 400
table_cache = 512
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

请问高手有没有好的建议?谢谢!
另外我也想过会不会操作系统本身也有什么地方没有优化好!

论坛徽章:
0
2 [报告]
发表于 2009-08-06 23:00 |只看该作者
期待高手指点一二!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP