我正在运行一些快速测试,试图估计发布和未来的硬件成本。
规格
Ubuntu Natty 11.04 64位Nginx 0.8.54m1.大型
我觉得我在这里一定做错了什么。我想做的估计有多少同时,在必须添加一台额外的机器之前,我可以支持。我正在使用django应用服务器,但现在我只是在测试nginx服务器的静态index.html页面
结果:
$ ab -n 10000 http://ec2-107-20-9-180.compute-1.amazonaws.com/
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 ec2-107-20-9-180.compute-1.amazonaws.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: nginx/0.8.54
Server Hostname: ec2-107-20-9-180.compute-1.amazonaws.com
Server Port: 80
Document Path: /
Document Length: 151 bytes
Concurrency Level: 1
Time taken for tests: 217.748 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 3620000 bytes
HTML transferred: 1510000 bytes
Requests per second: 45.92 [#/sec] (mean)
Time per request: 21.775 [ms] (mean)
Time per request: 21.775 [ms] (mean, across all concurrent requests)
Transfer rate: 16.24 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 9 11 10.3 10 971
Processing: 10 11 9.7 11 918
Waiting: 10 11 9.7 11 918
Total: 19 22 14.2 21 982
Percentage of the requests served within a certain time (ms)
50% 21
66% 21
75% 22
80% 22
90% 22
95% 23
98% 25
99% 35
100% 982 (longest request)
所以在我添加django后端之前,nginx的基本设置只能超过45 req/秒?这对一个m1大块头来说太可怕了…不是吗?
我做错了什么?
您只将并发级别设置为1。如果您想要更实际的结果,比如CCD_ 1。
Mark对并发性的看法。另外,我会花几块钱买一个像loadstorm.com这样的专业负载测试服务,并以这种方式非常成功。加大负载直至其断裂。创建真实的模拟流量(这对估计服务器容量很重要)并非易事,这些服务通过加载资源和跟踪链接等方式提供帮助。只加载一个静态页面不会得到非常逼真的数字。运行一些类似于真实应用程序的东西,并使用大量虚拟浏览器进行访问。你不能指望在只有一台机器产生流量的情况下找到配置良好的服务器的极限。