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的特性决定了其性能比其它对比的框架要高很多。

时间: 2024-08-30 09:12:32

Phalcon Hello World Benchmark(Hello World测试)的相关文章

AB(apache benchmark)压力测试

最近有使用来下AB,就把原来写的翻来出来,贴来出来,做个记录. AB(apache benchmark) 为Apache自带的性能测试工具在APACHE的bin目录下. 通过CMD进入apache的bin目录下,本例以windows下的apache为例. C:\Program Files\Apache Software Foundation\Apache2.2\bin> 格式: ab [options] [http://]hostname[:port]/path 参数: -n requests

压力测试之apache benchmark

ab 的全称是 ApacheBench , 是 Apache 附带的一个小工具 , 专门用于 HTTP Server 的 benchmark testing , 可以同时模拟多个并发请求.前段时间看到公司的开发人员也在用它作一些测试,看起来也不错,很简单,也很容易使用,所以今天花一点时间看了一下. 通过下面的一个简单的例子和注释,相信大家可以更容易理解这个工具的使用. Centos Linux安装Apache Benchmark, AB压力测试工具 yum install httpd-tools

c++性能测试工具:google benchmark入门(一)

如果你正在寻找一款c++性能测试工具,那么这篇文章是不容错过的. 市面上的benchmark工具或多或少存在一些使用上的不便,那么是否存在一个使用简便又功能强大的性能测试工具呢?答案是google/benchmark. google/benchmark是一个由Google开发的基于googletest框架的c++ benchmark工具,它易于安装和使用,并提供了全面的性能测试接口. 下面我将介绍google/benchmark的安装并用一个简短的例子介绍它的简单使用. 安装google/ben

改变测试思路,你的性能测试才能更值钱!(上)

性能测试的目的,简单说其实就是为了获取待测系统的响应时间.吞吐量.稳定性.容量等信息.而发现一些具体的性能相关的缺陷(如内存溢出.并发处理等问题),我认为只是一种附加结果.从更高的层次来说,性能测试最想发现的,是瓶颈.如何能得到所需要的信息,就需要从多方面进行测试. 性能测试的内容 1 性能测试种类的划分与定义这里就不说了,各有各的说法,比如性能测试.负载测试.压力测试这三个词,在网上能找到N个版本的定义,大体理解就行了,没必要在文字层面上较这个真.以下的内容也只是我个人的理解,一些名词的定义可

redis应用之安装配置介绍

一.redis介绍: 1.redis定义: Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起,Redis的开发工作由VMware主持.redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set --有序集合)和hash(哈希类型).这些数据类型都

[Redis]Redis 概述及基本使用规范.

1 nosql的简介 1.1 nosql简介 随着互联网Web2.0网站的兴起,传统的关系数据库在应付Web2.0网站,特别是超大规模和高并发的SNS类型的Web2.0纯动态网站已经显得力不从心,暴露了很多难以克服的问题,如: 1.1.1 对数据库高并发读写的需求 网站要根据用户个性化信息来实时生成动态页面和提供动态信息,所以基本上无法使用动态页面静态化技术,因此数据库并发负载非常高,往往要达到每秒上万次读写请求.关系数据库应付上万次SQL查询还勉强顶得住,但是应付上千万次SQL写数据请求,硬盘

颠覆大数据分析之Mesos:集群调度及管理系统

正如前面"Mesos:动机"一节中所述,Mesos的主要目标就是去帮助管理不同框架(或者应用栈)间的集群资源.比如说,有一个业务需要在同一个物理集群上同时运行Hadoop,Storm及Spark.这种情况下,现有的调度器是无法完成跨框架间的如此细粒度的资源共享的.Hadoop的YARN调度器是一个中央调度器,它可以允许多个框架运行在一个集群里.但是,要使用框架特定的算法或者调度策略的话就变得很难了,因为多个框架间只有一种调度算法.比如说,MPI使用的是组调度算法,而Spark用的是延迟

计算机视觉中的边缘检测

边缘检测是计算机视觉中最重要的概念之一.这是一个很直观的概念,在一个图像上运行图像检测应该只输出边缘,与素描比较相似.我的目标不仅是清晰地解释边缘检测是怎样工作的,同时也提供一个新而又容易的方法只需要最小工作来明显地提高边缘检测. 通过获得这些边缘,许多计算机算法才得以有可能实现,因为在一个场景中边缘包含着绝大部分(至少很多)的信息. 举个例子,我们都记得 Windows XP 的那个绿色小山坡和蓝色天空的背景. 当我们的大脑试图去理解这个场景时,我们知道这是草地,看起来很统一.然后,我们看到了

大数据高性能数据库Redis在Windows上的配置

Redis学习笔记----Redis在windows上的安装和配置 Redis简介 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set --有序集合)和hash(哈希类型).这些数据类型都支持push/pop.add/remove及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的.在此基础上,redis支持各种不同方式的排序.与memcach