laravel5.2、thinkphp5、thinkphp3.2.3性能AB测试
2016-05-17 12:53
579 查看
测试使用同一台机器、同一个数据库,同一个表,发现laravel语法和tp5语法相似度极高,而且性能也差不多,从数据上看tp5性能比laravel高一点点,但还没tp3高
请求5000次,并发200laravel
Requests per second: 1655.54 [#/sec] (mean)每秒请求数(平均)越大越好 Time per request: 120.807 [ms] (mean)每次并发请求时间越小越好 Time per request: 0.604 [ms] (mean, across all concurrent requests)每次并发请求时间越小越好
thinkphp5
Requests per second: 1697.69 [#/sec] (mean)每秒请求数(平均) 越大越好 Time per request: 117.807 [ms] (mean)每次并发请求时间 越小越好 Time per request: 0.589 [ms] (mean, across all concurrent requests))每次并发请求时间 越小越好
laravel代码
模型class DocumentArticle extends Model { protected $table = 'document_article'; // }
控制器
class IndexController extends Controller { public function index(){ $list = DocumentArticle::all(); return view('index', ['list' => $list]); } }
视图
@foreach ($list as $user) {{ $user->id }}:{!! $user->content !!} @endforeach
测试结果
Server Software: Apache/2.4.17 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /laravel/public Document Length: 340 bytes Concurrency Level: 200 Time taken for tests: 0.604 seconds Complete requests: 1000 Failed requests: 0 Non-2xx responses: 1000 Total transferred: 597000 bytes HTML transferred: 340000 bytes Requests per second: 1655.54 [#/sec] (mean) Time per request: 120.807 [ms] (mean) Time per request: 0.604 [ms] (mean, across all concurrent requests) Transfer rate: 965.19 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.4 0 1 Processing: 33 107 17.7 113 131 Waiting: 33 107 17.6 113 131 Total: 34 108 17.7 114 131 Percentage of the requests served within a certain time (ms) 50% 114 66% 115 75% 115 80% 116 90% 118 95% 121 98% 124 99% 127 100% 131 (longest request)
thinkphp5代码
模型class DocumentArticle extends Model { }
控制器
class Index extends Controller { public function index() { $list = DocumentArticle::all(); $this->assign('list',$list); return $this->fetch('index'); } }
视图
{volist name="list" id="vo"} {$vo.id}:{$vo.content}<br/> {/volist}
测试结果
Server Software: Apache/2.4.17 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /tp5/public Document Length: 336 bytes Concurrency Level: 200 Time taken for tests: 0.589 seconds Complete requests: 1000 Failed requests: 0 Non-2xx responses: 1000 Total transferred: 589000 bytes HTML transferred: 336000 bytes Requests per second: 1697.69 [#/sec] (mean) Time per request: 117.807 [ms] (mean) Time per request: 0.589 [ms] (mean, across all concurrent requests) Transfer rate: 976.51 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.4 0 1 Processing: 33 106 17.5 110 132 Waiting: 33 106 17.5 110 132 Total: 34 106 17.5 110 133 Percentage of the requests served within a certain time (ms) 50% 110 66% 115 75% 117 80% 118 90% 120 95% 121 98% 124 99% 127 100% 133 (longest request)
thinkphp3.2.3表现不错
Server Software: Apache/2.4.17 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /onetk Document Length: 331 bytes Concurrency Level: 200 Time taken for tests: 0.528 seconds Complete requests: 1000 Failed requests: 0 Non-2xx responses: 1000 Total transferred: 579000 bytes HTML transferred: 331000 bytes Requests per second: 1893.83 [#/sec] (mean) Time per request: 105.606 [ms] (mean) Time per request: 0.528 [ms] (mean, across all concurrent requests) Transfer rate: 1070.83 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.4 0 2 Processing: 27 95 15.5 99 121 Waiting: 27 94 15.5 98 121 Total: 28 95 15.5 99 121 Percentage of the requests served within a certain time (ms) 50% 99 66% 100 75% 100 80% 101 90% 108 95% 112 98% 117 99% 119 100% 121 (longest request)
相关文章推荐
- EditPlus注册码在线生成,强大
- 七牛EVM云主机ftp环境搭建以及注意事项
- 一款不错的PHP在线文件管理系统,PHP WEBFTP
- php 利用远程图片创建新图片完善(jpg,png,gif)
- php 利用远程png图片创建新png图片
- PHP图片合成加水印并生成缩略图
- php写守护进程(Daemon)
- php 利用远程图片创建新图片(jpg,gif,png)
- ThinkPHP中的调试模式
- php getimagesize获取图片信息(.jpg,.gif,.png)
- File 方法中 getParentFile()的用法及作用
- php 利用远程jpg图片创建新jpg图片
- 50个PHP程序性能优化的方法
- phpExcel
- php中对2个数组相加的函数
- php字符串函数
- php数据类型
- php 递归创建及删除目录
- php echo和print
- php 递归创建目录