幻想曲 发表于 2012-1-12 14:04:40

ci在并发压力测试时,表现不大好

用apache的ab工具
ab -n 1000 -c 10 http://localhost
控制器只是默认的:
public function index()
    {

      $this->load->view('welcome_message');

    }
结果为:

C:\Apache2.2\bin>ab -n 1000 -c 10 http://localhost/
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 localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:      Apache/2.2.21
Server Hostname:      localhost
Server Port:            80

Document Path:          /
Document Length:      1926 bytes

Concurrency Level:      10
Time taken for tests:   13.475 seconds
Complete requests:      1000
Failed requests:      0
Write errors:         0
Total transferred:      2114000 bytes
HTML transferred:       1926000 bytes
Requests per second:    74.21 [#/sec] (mean)
Time per request:       134.748 (mean)
Time per request:       13.475 (mean, across all concurrent requests)
Transfer rate:          153.21 received

Connection Times (ms)
            minmean[+/-sd] median   max
Connect:      0    0   1.6      0      16
Processing:    4713450.6    125   359
Waiting:       4713450.6    125   359
Total:         4713450.6    125   359

Percentage of the requests served within a certain time (ms)
50%    125
66%    156
75%    172
80%    172
90%    187
95%    219
98%    265
99%    297
100%    359 (longest request)

每秒只能处理74次请求,这正常么?

Hex 发表于 2012-1-12 15:13:04

性能测试可以参考 http://codeigniter.org.cn/forums/thread-419-1-1.html

longjianghu 发表于 2013-8-31 14:41:50

这个测试不具有实际意义,这个关键还是看人吧。
页: [1]
查看完整版本: ci在并发压力测试时,表现不大好