Phalcon Hello World Benchmark(Hello World测试)

How the benchmarks were performed?
我们如何执行的测试?
We created a “Hello World” benchmark seeking to identify the smallest load overhead of each framework. Many people don’t like this kind of benchmark because real-world applications require more complex features or structures. However, these tests identify the minimum time spent by each framework to perform a simple task. Such a task represents the minimum requirement for every framework to process a single request.
More specifically, the benchmark only measures the time it takes for a framework to start, run an action and free up resources at the end of the request. Any PHP application based on an MVC architecture will require this time. Due to the simplicity of the benchmark, we ensure that the time needed for a more complex request will be higher.
A controller and a view have been created for each framework. The controller “say” and action “hello”. The action only sends data to the view which displays it (“Hello!”). Using the “ab” benchmark tool we sent 2000 requests using 10 concurrent connections to each framework.
我们创建了一个hello world小程序对每个框架进行检测以找出最小负载的框架。许多人不喜欢这种测试,因为现实中的应用会比这个复杂的多。抛却这些,这些测试依然可以找出哪个框架处理请求时花费的时间最短。这个测试可以找出最小开销的那个框架。更确切的说,这个测试仅测试从应用开始到资源想释放的时间。这个时间是每个PHP MVC框架都会有的开销。鉴于此测试比较简单,我们可以确定的是在复杂的应用中这个时间肯定会有所增加的。每个框架中的控制器和视图都被创建了。使用say控制器hello action.这个动作仅发送了一个”Hello”字串到视图中。这里我们使用apache自带的ab测试工具发送2000个请求使用10个并发对每个框架进行测试。
What measurements were recorded?¶
These were the measurements we record to identify the overall performance of each framework:
Requests per second
Time across all concurrent requests
Number of included PHP files on a single request (measured using function get_included_files.
Memory Usage per request (measured using function memory_get_usage.
测试工具记录了哪些记录值?
这里记录一些可以显示出各个框架性能的参数:
每秒请示数
所有并发请示所花的时间
单个请求中所引入的PHP文件数(需要使用get_included_files函数)
单个请示的内存使用量(使用memory_get_usage函数)

Participant Frameworks(测试的框架)¶
Yii
Symfony
Zend Framework
Kohana
FuelPHP
Laravel
CodeIgniter
How the benchmarks were performed?
我们如何执行的测试?
We created a “Hello World” benchmark seeking to identify the smallest load overhead of each framework. Many people don’t like this kind of benchmark because real-world applications require more complex features or structures. However, these tests identify the minimum time spent by each framework to perform a simple task. Such a task represents the minimum requirement for every framework to process a single request.
More specifically, the benchmark only measures the time it takes for a framework to start, run an action and free up resources at the end of the request. Any PHP application based on an MVC architecture will require this time. Due to the simplicity of the benchmark, we ensure that the time needed for a more complex request will be higher.
A controller and a view have been created for each framework. The controller “say” and action “hello”. The action only sends data to the view which displays it (“Hello!”). Using the “ab” benchmark tool we sent 2000 requests using 10 concurrent connections to each framework.
我们创建了一个hello world小程序对每个框架进行检测以找出最小负载的框架。许多人不喜欢这种测试,因为现实中的应用会比这个复杂的多。抛却这些,这些测试依然可以找出哪个框架处理请求时花费的时间最短。这个测试可以找出最小开销的那个框架。更确切的说,这个测试仅测试从应用开始到资源想释放的时间。这个时间是每个PHP MVC框架都会有的开销。鉴于此测试比较简单,我们可以确定的是在复杂的应用中这个时间肯定会有所增加的。每个框架中的控制器和视图都被创建了。使用say控制器hello action.这个动作仅发送了一个”Hello”字串到视图中。这里我们使用apache自带的ab测试工具发送2000个请求使用10个并发对每个框架进行测试。
What measurements were recorded?
These were the measurements we record to identify the overall performance of each framework:
Requests per second
Time across all concurrent requests
Number of included PHP files on a single request (measured using function get_included_files.
Memory Usage per request (measured using function memory_get_usage.
测试工具记录了哪些记录值?
这里记录一些可以显示出各个框架性能的参数:
每秒请示数
所有并发请示所花的时间
单个请求中所引入的PHP文件数(需要使用get_included_files函数)
单个请示的内存使用量(使用memory_get_usage函数)

Participant Frameworks(测试的框架)
Yii
Symfony
Zend Framework
Kohana
FuelPHP
Laravel

CodeIgniter




# ab -n 2000 -c 10 http://localhost/bench/helloworld/yii/index.php?r=say/hello
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)




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


Document Path:          /bench/helloworld/yii/index.php?r=say/hello
Document Length:        61 bytes


Concurrency Level:      10
Time taken for tests:   2.081 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      508000 bytes
HTML transferred:       122000 bytes
Requests per second:    961.28 [#/sec] (mean)
Time per request:       10.403 [ms] (mean)
Time per request:       1.040 [ms] (mean, across all concurrent requests)
Transfer rate:          238.44 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   10   4.3      9      42
Processing:     0    0   1.0      0      24
Waiting:        0    0   0.8      0      17
Total:          3   10   4.3      9      42


Percentage of the requests served within a certain time (ms)
  50%      9
  66%     11
  75%     13
  80%     14
  90%     15
  95%     17
  98%     21
  99%     26
 100%     42 (longest request)
Symfony Version 2.1.6¶
# ab -n 2000 -c 10 http://localhost/bench/Symfony/web/app.php/say/hello/
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)




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


Document Path:          /bench/Symfony/web/app.php/say/hello/
Document Length:        16 bytes


Concurrency Level:      5
Time taken for tests:   1.848 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      249000 bytes
HTML transferred:       16000 bytes
Requests per second:    541.01 [#/sec] (mean)
Time per request:       9.242 [ms] (mean)
Time per request:       1.848 [ms] (mean, across all concurrent requests)
Transfer rate:          131.55 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    9   4.8      8      61
Processing:     0    0   0.6      0      15
Waiting:        0    0   0.6      0      15
Total:          4    9   4.8      8      61


Percentage of the requests served within a certain time (ms)
  50%      8
  66%      9
  75%     11
  80%     12
  90%     15
  95%     18
  98%     22
  99%     30
 100%     61 (longest request)
CodeIgniter 2.1.0¶
# ab -n 2000 -c 10 http://localhost/bench/codeigniter/index.php/say/hello
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)




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


Document Path:          /bench/helloworld/codeigniter/index.php/say/hello
Document Length:        16 bytes


Concurrency Level:      10
Time taken for tests:   1.888 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      418000 bytes
HTML transferred:       32000 bytes
Requests per second:    1059.05 [#/sec] (mean)
Time per request:       9.442 [ms] (mean)
Time per request:       0.944 [ms] (mean, across all concurrent requests)
Transfer rate:          216.15 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    9   4.1      9      33
Processing:     0    0   0.8      0      19
Waiting:        0    0   0.7      0      16
Total:          3    9   4.2      9      33


Percentage of the requests served within a certain time (ms)
  50%      9
  66%     10
  75%     11
  80%     12
  90%     14
  95%     16
  98%     21
  99%     24
 100%     33 (longest request)
Kohana 3.2.0¶
# ab -n 2000 -c 10 http://localhost/bench/helloworld/kohana/index.php/say/hello
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)




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


Document Path:          /bench/helloworld/kohana/index.php/say/hello
Document Length:        15 bytes


Concurrency Level:      10
Time taken for tests:   2.324 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      446446 bytes
HTML transferred:       30030 bytes
Requests per second:    860.59 [#/sec] (mean)
Time per request:       11.620 [ms] (mean)
Time per request:       1.162 [ms] (mean, across all concurrent requests)
Transfer rate:          187.60 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   11   5.1     10      64
Processing:     0    0   1.9      0      39
Waiting:        0    0   1.4      0      35
Total:          3   11   5.3     11      64


Percentage of the requests served within a certain time (ms)
  50%     11
  66%     13
  75%     15
  80%     15
  90%     17
  95%     18
  98%     24
  99%     31
 100%     64 (longest request)
Fuel 1.2.1¶
# ab -n 2000 -c 10 http://localhost/bench/helloworld/fuel/public/say/hello
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)




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


Document Path:          /bench/helloworld/fuel/public/say/hello
Document Length:        16 bytes


Concurrency Level:      10
Time taken for tests:   2.742 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      418000 bytes
HTML transferred:       32000 bytes
Requests per second:    729.42 [#/sec] (mean)
Time per request:       13.709 [ms] (mean)
Time per request:       1.371 [ms] (mean, across all concurrent requests)
Transfer rate:          148.88 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   13   6.0     12      79
Processing:     0    0   1.3      0      22
Waiting:        0    0   0.8      0      21
Total:          4   14   6.1     13      80


Percentage of the requests served within a certain time (ms)
  50%     13
  66%     15
  75%     17
  80%     17
  90%     19
  95%     24
  98%     30
  99%     38
 100%     80 (longest request)
Zend Framework 1.11.11¶
# ab -n 2000 -c 10 http://localhost/bench/helloworld/zendfw/public/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 localhost (be patient)




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


Document Path:          /bench/helloworld/zendfw/public/index.php
Document Length:        16 bytes


Concurrency Level:      10
Time taken for tests:   5.641 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      418000 bytes
HTML transferred:       32000 bytes
Requests per second:    354.55 [#/sec] (mean)
Time per request:       28.205 [ms] (mean)
Time per request:       2.820 [ms] (mean, across all concurrent requests)
Transfer rate:          72.36 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   27   9.6     25      89
Processing:     0    1   3.0      0      70
Waiting:        0    0   2.9      0      70
Total:          9   28   9.6     26      90


Percentage of the requests served within a certain time (ms)
  50%     26
  66%     28
  75%     32
  80%     34
  90%     41
  95%     46
  98%     55
  99%     62
 100%     90 (longest request)
Laravel 3.2.5¶
# ab -n 2000 -c 10 http://localhost/bench/helloworld/laravel/public/say/hello


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)




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


Document Path:          /bench/helloworld/laravel/public/say/hello
Document Length:        15 bytes


Concurrency Level:      10
Time taken for tests:   4.090 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      1665162 bytes
HTML transferred:       30045 bytes
Requests per second:    489.03 [#/sec] (mean)
Time per request:       20.449 [ms] (mean)
Time per request:       2.045 [ms] (mean, across all concurrent requests)
Transfer rate:          397.61 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   20   7.6     19      92
Processing:     0    0   2.5      0      53
Waiting:        0    0   2.5      0      53
Total:          6   20   7.6     19      93


Percentage of the requests served within a certain time (ms)
  50%     19
  66%     21
  75%     23
  80%     24
  90%     29
  95%     34
  98%     42
  99%     48
 100%     93 (longest request)
Phalcon Version 0.8.0¶
# ab -n 2000 -c 10 http://localhost/bench/helloworld/phalcon/index.php?_url=/say/hello
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)




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


Document Path:          /bench/helloworld/phalcon/index.php?_url=/say/hello
Document Length:        16 bytes


Concurrency Level:      10
Time taken for tests:   0.789 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      418000 bytes
HTML transferred:       32000 bytes
Requests per second:    2535.82 [#/sec] (mean)
Time per request:       3.943 [ms] (mean)
Time per request:       0.394 [ms] (mean, across all concurrent requests)
Transfer rate:          517.56 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    4   1.7      3      23
Processing:     0    0   0.2      0       6
Waiting:        0    0   0.2      0       6
Total:          2    4   1.7      3      23


Percentage of the requests served within a certain time (ms)
  50%      3
  66%      4
  75%      4
  80%      4
  90%      5
  95%      6
  98%      8
  99%     14
 100%     23 (longest request)


图表

第一个图显示了每秒可以处理的请求数。第二个图显示了并发时处理每个请示所花的时间。











结论

Phalcon的特性决定了其性能比其它对比的框架要高很多。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值