服务器vm虚拟机 1核1G
环境 :nginx/1.13.8 + php7.2.1 + mysql 5.7.2
环境 :swoole 2.0.12
mixphp 2.0.1
默认代码:
class IndexController extends Controller { // 默认动作 public function actionIndex() { return 'Hello World' . PHP_EOL; }
ab -c 150 -n 100000 http://192.168.11.109:9501/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.11.109 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: swoole-http-server
Server Hostname: 192.168.11.109
Server Port: 9501
Document Path: /
Document Length: 12 bytes
Concurrency Level: 150
Time taken for tests: 24.486 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 17400000 bytes
HTML transferred: 1200000 bytes
Requests per second: 4083.92 [#/sec] (mean)
Time per request: 36.729 [ms] (mean)
Time per request: 0.245 [ms] (mean, across all concurrent requests)
Transfer rate: 693.95 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 28.3 0 1091
Processing: 2 36 14.1 34 506
Waiting: 2 35 14.1 34 506
Total: 2 37 31.6 34 1128
Percentage of the requests served within a certain time (ms)
50% 34
66% 36
75% 37
80% 38
90% 44
95% 53
98% 66
99% 84
100% 1128 (longest request)
easyswoole 2.0.1
代码:
namespace App\Controller;
use EasySwoole\Core\Http\AbstractInterface\Controller;
class Index extends Controller
{
function index()
{
$this->response()->write("hello word!!");
// TODO: Implement index() method.
}
}
?>
ab -c 150 -n 100000 http://192.168.11.109:9501/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.11.109 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: swoole-http-server
Server Hostname: 192.168.11.109
Server Port: 9501
Document Path: /
Document Length: 21 bytes
Concurrency Level: 150
Time taken for tests: 33.115 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 17700000 bytes
HTML transferred: 2100000 bytes
Requests per second: 3019.74 [#/sec] (mean)
Time per request: 49.673 [ms] (mean)
Time per request: 0.331 [ms] (mean, across all concurrent requests)
Transfer rate: 521.97 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.6 0 11
Processing: 8 49 19.3 48 223
Waiting: 7 49 19.3 48 221
Total: 8 50 19.4 48 232
Percentage of the requests served within a certain time (ms)
50% 48
66% 57
75% 63
80% 66
90% 74
95% 81
98% 88
99% 95
100% 232 (longest request)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
yaf3.0.6在php-fpm下运行结果
代码:
define ("APPLICATION_PATH", dirname(__FILE__));
$app = new Yaf_Application(APPLICATION_PATH . "/conf/application.ini");
$app->bootstrap() //call bootstrap methods defined in Bootstrap.php
->run();
?>
ab -c 150 -n 100000 http://192.168.11.109/yaf/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.11.109 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: nginx/1.13.8
Server Hostname: 192.168.11.109
Server Port: 80
Document Path: /yaf/
Document Length: 11 bytes
Concurrency Level: 150
Time taken for tests: 63.561 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 17300000 bytes
HTML transferred: 1100000 bytes
Requests per second: 1573.30 [#/sec] (mean)
Time per request: 95.341 [ms] (mean)
Time per request: 0.636 [ms] (mean, across all concurrent requests)
Transfer rate: 265.80 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.4 0 8
Processing: 42 94 112.7 83 3101
Waiting: 42 94 112.7 83 3101
Total: 42 94 112.7 83 3101
Percentage of the requests served within a certain time (ms)
50% 83
66% 84
75% 86
80% 87
90% 92
95% 95
98% 109
99% 1067
100% 3101 (longest request)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
thinkphp5.0.14
代码:
namespace app\index\controller;
class Index{
public function index(){
return 'index';
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ab -c 150 -n 100000 http://192.168.11.109/thinkphp5/public/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.11.109 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: nginx/1.13.8
Server Hostname: 192.168.11.109
Server Port: 80
Document Path: /thinkphp5/public/
Document Length: 11 bytes
Concurrency Level: 150
Time taken for tests: 113.376 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 17300000 bytes
HTML transferred: 1100000 bytes
Requests per second: 882.02 [#/sec] (mean)
Time per request: 170.065 [ms] (mean)
Time per request: 1.134 [ms] (mean, across all concurrent requests)
Transfer rate: 149.01 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.6 0 12
Processing: 18 168 151.2 140 3209
Waiting: 17 168 151.2 140 3209
Total: 22 169 151.2 141 3209
Percentage of the requests served within a certain time (ms)
50% 141
66% 151
75% 160
80% 164
90% 178
95% 210
98% 1120
99% 1145
100% 3209 (longest request)