nginx配置么:
location /image/ {
gridfs static_file root_collection=images field=filename type=string;
mongo 127.0.0.1:27017;
}
浏览器试运行,不错,可以看到图,OK,下面按照帖子中的测试方式:
ab -n 50000 -c 10 http://192.168.2.131/image/hh.png
结果...
Server Software: nginx/0.8.52
Server Hostname: 192.168.2.131
Server Port: 80
Document Path: /image/hh.png
Document Length: 25338 bytes
Concurrency Level: 10
Time taken for tests: 628.173000 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 1274150000 bytes
HTML transferred: 1266900000 bytes
Requests per second: 79.60 [#/sec] (mean)
Time per request: 125.635 [ms] (mean)
Time per request: 12.563 [ms] (mean, across all concurrent requests)
Transfer rate: 1980.80 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 11 97.8 2 3055
Processing: 3 114 298.9 62 4001
Waiting: 0 79 242.9 30 3144
Total: 6 125 314.6 69 4004
Percentage of the requests served within a certain time (ms)
50% 69
66% 110
75% 129
80% 152
90% 232
95% 288
98% 370
99% 3016
100% 4004 (longest request)
额,这个就有点杯具了,与帖子上的结果也差太多了吧。好吧,按照鲜花总要有绿叶衬托,
再试一下所谓的nginx直接读文件:
Server Software: nginx/0.8.52
Server Hostname: 192.168.2.131
Server Port: 80
Document Path: /pe-logo-big.png
Document Length: 25338 bytes
Concurrency Level: 10
Time taken for tests: 934.880000 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 1281150000 bytes
HTML transferred: 1266900000 bytes
Requests per second: 53.48 [#/sec] (mean)
Time per request: 186.976 [ms] (mean)
Time per request: 18.698 [ms] (mean, across all concurrent requests)
Transfer rate: 1338.27 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 165.1 3 3123
Processing: 3 168 500.1 69 10197
Waiting: 0 77 362.7 14 6119
Total: 5 186 525.6 74 10200
Percentage of the requests served within a certain time (ms)
50% 74
66% 111
75% 130
80% 159
90% 263
95% 296
98% 3035
99% 3097
100% 10200 (longest request)
好吧在绿叶的衬托下,鲜花是有那么点吸引人之处了(虽然和那篇神帖结果截然相反了)。
不过也有可能在nginx时没有做缓存的缘故。
之所以在标题上加了个“残”,很显然,革命尚未成功啊。。后文待我喘过气再表!