PHP框架性能测试报告
作者:极客头条 发布时间:[ 2016/9/13 11:28:48 ] 推荐标签:软件测试 性能测试 框架
然后是Laravel
Transactions: 1890 hits
Availability: 94.50 %
Elapsed time: 51.85 secs
Data transferred: 198.27 MB
Response time: 4.88 secs
Transaction rate: 36.45 trans/sec
Throughput: 3.82 MB/sec
Concurrency: 178.00
Successful transactions: 1890
Failed transactions: 110
Longest transaction: 26.01
Shortest transaction: 0.07
后是Yii
Transactions: 1996 hits
Availability: 99.80 %
Elapsed time: 18.95 secs
Data transferred: 209.39 MB
Response time: 1.79 secs
Transaction rate: 105.33 trans/sec
Throughput: 11.05 MB/sec
Concurrency: 188.57
Successful transactions: 1996
Failed transactions: 4
Longest transaction: 3.29
Shortest transaction: 0.10
没想到在没有优化的情况下,ThinkPHP的速度是快的,Yii略微多一些,Laravel步履蹒跚的跑完了测试。结果是有些出人意料的,不过上述的测试只代表了开发环境,下面会对框架进行优化,模拟线上环境。
优化框架
ThinkPHP:
APP_DEBUG改为false
Laravel:
APP_DEBUG改为false
php artisan route:cache
php artisan optimize
php artisan config:cache
composer dumpautoload -o
Yii:
YII_DEBUG改为false
composer dumpautoload -o
并发200循环10次:
ThinkPHP
Transactions: 1655 hits
Availability: 82.75 %
Elapsed time: 8.21 secs
Data transferred: 173.62 MB
Response time: 0.69 secs
Transaction rate: 201.58 trans/sec
Throughput: 21.15 MB/sec
Concurrency: 139.29
Successful transactions: 1655
Failed transactions: 345
Longest transaction: 7.83
Shortest transaction: 0.00
Laravel:
Transactions: 1520 hits
Availability: 76.00 %
Elapsed time: 34.95 secs
Data transferred: 159.45 MB
Response time: 3.15 secs
Transaction rate: 43.49 trans/sec
Throughput: 4.56 MB/sec
Concurrency: 136.84
Successful transactions: 1520
Failed transactions: 480
Longest transaction: 19.18
Shortest transaction: 0.00
Yii:
Transactions: 1704 hits
Availability: 85.20 %
Elapsed time: 15.16 secs
Data transferred: 178.76 MB
Response time: 1.46 secs
Transaction rate: 112.40 trans/sec
Throughput: 11.79 MB/sec
Concurrency: 164.21
Successful transactions: 1704
Failed transactions: 296
Longest transaction: 9.04
Shortest transaction: 0.00
比较奇怪的一点,当框架关掉调试模式后都出现了较多失败的情况。不过明显的看到,Laravel进行简单的优化后,性能大大的提升了,但还是低于其他两个框架。
结论
在测试的过程中,其他我的心情是沮丧的,感觉自己的三观世界已经崩塌了,崩塌至渣。
ThinkPHP的性能比Yii高出一倍,比Laravel高出近四倍
Yii的性能比较中庸,但是在测试中会明显发现请求失败的情况比其他两个框架要少
Laravel依旧优雅,不过性能堪忧,用网友的话形容比较好 学之者生用之者死
后
我的项目后使用了自建框架进行开发,得益于composer的强大,开发的过程非常顺利,后附上自有框架在200并发10次循环的数据,框架开源但是更新比较忙,欢迎在github上搜索PPPHP,和我一起搭建框架。
Transactions: 1672 hits
Availability: 83.60 %
Elapsed time: 6.18 secs
Data transferred: 175.40 MB
Response time: 0.57 secs
Transaction rate: 270.55 trans/sec
Throughput: 28.38 MB/sec
Concurrency: 153.16
Successful transactions: 1672
Failed transactions: 328
Longest transaction: 4.57
Shortest transaction: 0.01
本文内容不用于商业目的,如涉及知识产权问题,请权利人联系SPASVO小编(021-61079698-8054),我们将立即处理,马上删除。
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11热门文章
常见的移动App Bug??崩溃的测试用例设计如何用Jmeter做压力测试QC使用说明APP压力测试入门教程移动app测试中的主要问题jenkins+testng+ant+webdriver持续集成测试使用JMeter进行HTTP负载测试Selenium 2.0 WebDriver 使用指南