我最近在给tastphp 完善说明文档 有一节是性能测试比较 ,才有了下面这个项目,有什么说的不对的地方,大家给我指正。一起交流才有进步!

针对 github 上比较活跃的几个开源项目,做了简单的比较。供大家参考:

php framework benchmark (include laravel、symfony、silex、lumen、slim、yii2、tastphp)

所有框架仅输出 "ok",就仅测试框架的本身的性能。如果有精力可以测下带有数据库交互的测试。

以下测试仅供参考,如果你想测的准,建议在生产环境测试!

测试的环境

OS Name: Mac OS X

OS Version: 10.12.6

Architecture: x86_64

CPU:Intel Core i7 1.7 GHz *2

RAM:8 GB

PHP version 7.1.10

各个框架的版本

Laravel version 5.5.0

Lumen version 5.5.0

symfony version 3.3.10

Silex version 2.0.2

Silm version 3.1.4

yii2 version 2.0.12

Tastphp version 1.3.6

测试结果

Detail

Laravel ab test

Laravel version 5.5.0

run commands before test:

composer install --optimize-autoloader

php artisan config:cache

// php artisan route:cache //cannot use route caching if you have ANY route closures

ab test result:

➜ laravel-5.5.0 git:(master) ✗ ab -n 1000 -c 100 http://laravel-benchmark.dev/

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking laravel-benchmark.dev (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: nginx/1.12.0

Server Hostname: laravel-benchmark.dev

Server Port: 80

Document Path: /

Document Length: 2 bytes

Concurrency Level: 100

Time taken for tests: 3.295 seconds

Complete requests: 1000

Failed requests: 0

Total transferred: 982346 bytes

HTML transferred: 2000 bytes

Requests per second: 303.46 [#/sec] (mean)

Time per request: 329.538 [ms] (mean)

Time per request: 3.295 [ms] (mean, across all concurrent requests)

Transfer rate: 291.11 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 1 1.8 0 8

Processing: 22 311 59.4 315 571

Waiting: 22 311 59.4 315 571

Total: 30 312 58.0 315 571

Percentage of the requests served within a certain time (ms)

50% 315

66% 335

75% 351

80% 354

90% 362

95% 367

98% 378

99% 407

100% 571 (longest request)

Lumen version 5.5.0

run commands before test:

composer install --optimize-autoloader

ab test result:

➜ lumen-5.5.0 git:(master) ✗ ab -n 1000 -c 100 http://lumen-benchmark.dev/

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking lumen-benchmark.dev (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: nginx/1.12.0

Server Hostname: lumen-benchmark.dev

Server Port: 80

Document Path: /

Document Length: 2 bytes

Concurrency Level: 100

Time taken for tests: 0.639 seconds

Complete requests: 1000

Failed requests: 0

Total transferred: 199000 bytes

HTML transferred: 2000 bytes

Requests per second: 1565.02 [#/sec] (mean)

Time per request: 63.897 [ms] (mean)

Time per request: 0.639 [ms] (mean, across all concurrent requests)

Transfer rate: 304.14 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.9 0 6

Processing: 9 61 9.9 62 74

Waiting: 9 61 9.9 62 74

Total: 14 61 9.1 62 74

Percentage of the requests served within a certain time (ms)

50% 62

66% 64

75% 65

80% 66

90% 68

95% 71

98% 72

99% 73

100% 74 (longest request)

Symfony version 3.3.10

run commands before test:

composer install --optimize-autoloader

ab test result:

➜ symfony-3.3.10 git:(master) ✗ ab -n 1000 -c 100 http://symfony-benchmark.dev/

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking symfony-benchmark.dev (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: nginx/1.12.0

Server Hostname: symfony-benchmark.dev

Server Port: 80

Document Path: /

Document Length: 2 bytes

Concurrency Level: 100

Time taken for tests: 1.716 seconds

Complete requests: 1000

Failed requests: 0

Total transferred: 237000 bytes

HTML transferred: 2000 bytes

Requests per second: 582.60 [#/sec] (mean)

Time per request: 171.646 [ms] (mean)

Time per request: 1.716 [ms] (mean, across all concurrent requests)

Transfer rate: 134.84 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 1 0.9 0 5

Processing: 12 163 34.6 168 218

Waiting: 12 163 34.6 168 218

Total: 17 163 33.9 169 218

WARNING: The median and mean for the initial connection time are not within a normal deviation

These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)

50% 169

66% 176

75% 184

80% 187

90% 199

95% 207

98% 211

99% 213

100% 218 (longest request)

Silex version 2.0.2

run commands before test:

composer install --optimize-autoloader

ab test result:

➜ silex-2.0.2 git:(master) ✗ ab -n 1000 -c 100 http://silex-benchmark.dev/

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking silex-benchmark.dev (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: nginx/1.12.0

Server Hostname: silex-benchmark.dev

Server Port: 80

Document Path: /

Document Length: 2 bytes

Concurrency Level: 100

Time taken for tests: 0.747 seconds

Complete requests: 1000

Failed requests: 0

Total transferred: 237000 bytes

HTML transferred: 2000 bytes

Requests per second: 1338.53 [#/sec] (mean)

Time per request: 74.709 [ms] (mean)

Time per request: 0.747 [ms] (mean, across all concurrent requests)

Transfer rate: 309.80 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.9 0 4

Processing: 15 71 9.3 73 88

Waiting: 15 71 9.3 73 88

Total: 20 72 8.6 73 89

Percentage of the requests served within a certain time (ms)

50% 73

66% 74

75% 75

80% 76

90% 79

95% 81

98% 82

99% 84

100% 89 (longest request)

slim version 3.1.4

run commands before test:

composer install --optimize-autoloader

ab test:

➜ silm-3.1.4 git:(master) ✗ ab -n 1000 -c 100 http://slim-benchmark.dev/

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking slim-benchmark.dev (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: nginx/1.12.0

Server Hostname: slim-benchmark.dev

Server Port: 80

Document Path: /

Document Length: 2 bytes

Concurrency Level: 100

Time taken for tests: 0.703 seconds

Complete requests: 1000

Failed requests: 0

Total transferred: 333000 bytes

HTML transferred: 2000 bytes

Requests per second: 1423.44 [#/sec] (mean)

Time per request: 70.252 [ms] (mean)

Time per request: 0.703 [ms] (mean, across all concurrent requests)

Transfer rate: 462.90 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 1.0 0 5

Processing: 7 67 15.7 65 210

Waiting: 7 66 15.7 65 210

Total: 12 67 15.1 66 210

Percentage of the requests served within a certain time (ms)

50% 66

66% 69

75% 70

80% 72

90% 88

95% 96

98% 102

99% 105

100% 210 (longest request)

yii2 version 2.0.12

run commands before test:

composer install --optimize-autoloader

ab test result:

➜ yii2-2.0.12 git:(master) ✗ ab -n 1000 -c 100 http://yii2-benchmark.dev/

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking yii2-benchmark.dev (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: nginx/1.12.0

Server Hostname: yii2-benchmark.dev

Server Port: 80

Document Path: /

Document Length: 2 bytes

Concurrency Level: 100

Time taken for tests: 0.649 seconds

Complete requests: 1000

Failed requests: 0

Total transferred: 165000 bytes

HTML transferred: 2000 bytes

Requests per second: 1539.74 [#/sec] (mean)

Time per request: 64.946 [ms] (mean)

Time per request: 0.649 [ms] (mean, across all concurrent requests)

Transfer rate: 248.10 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 1.0 0 5

Processing: 16 62 9.2 61 96

Waiting: 16 62 9.2 61 96

Total: 21 62 9.2 61 98

Percentage of the requests served within a certain time (ms)

50% 61

66% 64

75% 67

80% 69

90% 73

95% 77

98% 89

99% 94

100% 98 (longest request)

Tastphp version 1.3.6

run commands before test:

composer install --optimize-autoloader

php bin/console cache:config

php bin/console cache:route

➜ tastphp-1.3.6 git:(master) mv config/example.app.yml config/app.yml

➜ tastphp-1.3.6 git:(master) cat config/app.yml

version: v1.3.6

debug: false

secret: tastphp

# dev | test | prod

env: prod

timezone: UTC

name: tastphp

ab test result:

➜ tastphp-1.3.6 git:(master) ✗ ab -n 1000 -c 100 http://tastphp-benchmark.dev/

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking tastphp-benchmark.dev (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: nginx/1.12.0

Server Hostname: tastphp-benchmark.dev

Server Port: 80

Document Path: /

Document Length: 2 bytes

Concurrency Level: 100

Time taken for tests: 0.487 seconds

Complete requests: 1000

Failed requests: 0

Total transferred: 165000 bytes

HTML transferred: 2000 bytes

Requests per second: 2051.92 [#/sec] (mean)

Time per request: 48.735 [ms] (mean)

Time per request: 0.487 [ms] (mean, across all concurrent requests)

Transfer rate: 330.63 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.8 0 4

Processing: 7 46 7.5 48 55

Waiting: 7 46 7.5 48 55

Total: 11 46 6.8 48 56

Percentage of the requests served within a certain time (ms)

50% 48

66% 49

75% 50

80% 51

90% 52

95% 53

98% 54

99% 55

100% 56 (longest request)

广告时间

start 关注下:

最近也在编写以实际项目来说明 tastphp 的简单优雅好用

欢迎 PR、issure 给我

你的 star,确实给我不小鼓励!让我坚持下去。祝国内产生更多优秀的开源产品!

php 框架效率测试,2017 非标准 PHP 框架性能测试比较相关推荐

  1. php 框架效率测试,关于DoitPHP,ThinkPHP,Yii,CI,DooPHP等框架的性能对比测试

    DoitPHP(原Tommyframework)是一个基于BSD开源协议发布的轻量级PHP框架.DoitPHP运行高效,易学易用,易于扩展.DoitPHP秉承了那些优秀的PHP框架所共有的:代码的OO ...

  2. ORM for Net主流框架汇总与效率测试

    框架已经被越来越多的人所关注与使用了,今天我们就来研究一下net方面的几个主流ORM框架,以及它们的效率测试(可能会有遗漏欢迎大家讨论). ORM框架:Object/Relation Mapping( ...

  3. 10个自动化测试框架,测试工程师用起来

    快速实现质量是必要的,因此质量保证得到了很多关注.为了满足卓越的质量和更快的上市时间的需求,自动化测试将被优先考虑.对于微型.小型和中型企业(SMEs)来说,自动化自身的测试过程是非常必要的,而最关键 ...

  4. 华为python自动化测试框架_10个自动化测试框架,测试工程师用起来

    摘要:快速实现质量是必要的,因此质量保证得到了很多关注.为了满足卓越的质量和更快的上市时间的需求,自动化测试将被优先考虑.对于微型.小型和中型企业(SMEs)来说,自动化自身的测试过程是非常必要的,而 ...

  5. 震撼发布2017年Android百大框架排行榜

    一.榜单介绍 排行榜包括四大类: 单一框架:仅提供路由.网络层.UI层.通信层或其他单一功能的框架 混合开发框架:提供开发hybrid app.h5与webview结合能力.web app能力的框架 ...

  6. Linux BSP非标准HDMI分辨率

    Linux BSP非标准HDMI分辨率 Intrinsyc公司发布了它的一个新的Linux BSP软件的发布 打开-Q™820 开发套件基于Linux内核版本.支持的软件功能包括HDMI输出,可以支持 ...

  7. 阿里配管专家解读:如何最优成本搭建非标准的iOS构建集群

    作者简介:董必胜(叔大),阿里巴巴配置管理专家,负责集团.蚂蚁的移动端构建,负责研发协同平台RDC无线. 背景:在移动物联网大潮中iOS构建的重要性日益突出,如何能提供稳定的iOS构建服务?中大型的企 ...

  8. python测试框架untest_Python测试框架之unittest和pytest

    目前搜狗商城接口测试框架用的是unittest+HTMLTestRunner,case数有1097条,目前运行一次自动化测试,时长约为30分钟,期望控制在10分钟或者更短的时间内.近期打算重新优化框架 ...

  9. MaxCompute平台非标准日期和气象数据处理方法--以电力AI赛为例

    摘要:MaxCompute平台支持的日期格式通常是对齐的日期格式诸如20170725或2017/07/25这种,而本次电力AI赛提供的日期格式却是未对齐的非标准(相对MaxCompute平台来说)的日 ...

最新文章

  1. 易写易库(EXEK)玩“花”儿之三:命令有图标支持库,附图
  2. 18-Gm-TransH:Group-Constrained Embedding of Multi-fold Relations in Knowledge Bases,嵌入,transH,n-ary
  3. switch 选择语句
  4. bzoj 1672: [Usaco2005 Dec]Cleaning Shifts 清理牛棚(DP)
  5. 线程间通信与协作方式之——wait-notify机制
  6. 机器学习实战pdf原文内容分享
  7. matlab app designer:夫琅禾费圆孔衍射仿真
  8. DarkNet yoloV2 转到caffe使用
  9. linux sfc模拟器,PSP适用SFC模拟器Snes9x完全使用教程
  10. 十年饮冰鸿蒙将至,咕哒:十年饮冰难凉热血 十年头牌阿联可称忠烈
  11. 有了ElasticSearch为什么还要用MySQL?-这篇文章告诉你
  12. FICO 财务替代创建
  13. 2021-10-11
  14. C#如何新建Excel
  15. 知网 万方 论文免费下载方法
  16. 数据挖掘中的数据预处理方法总结
  17. DialogBox函数参数
  18. android 瀑布流 空白,Android瀑布流优化,解决Recyclerview展示大批量图片时Item自动切换、闪烁、空白等问题...
  19. 无器械健身和器械健身比较 1
  20. cssrem转换工具_css之px自动转rem—“懒人”必备

热门文章

  1. c++指定在某一线程运行_深入理解Java虚拟机-运行时数据区
  2. 【英语学习】【Daily English】U06 Shopping L03 What sort of market are you looking for?
  3. find的用法_【同步练习】高一英语下册find+复合宾语用法
  4. php熊掌号怎么设置json-ld,织梦DEDECMS熊掌号JSON LD结构化数据代码分享
  5. java springmvc https_【Java Web开发学习】Spring MVC 使用HTTP信息转换器
  6. Predicate函数式接口
  7. python全栈开发笔记---------数据类型-----集合set
  8. Devexpress中Tdxnavbar的使用
  9. Asp.Net Web API(四)
  10. zabbix-2.0.8日常巡检-检测项目状态