hyperf qps 与 laravel10 + octane qps 对比
laravel10 + octane
laravel 10 qps
使用
octane
启动 laravel, 开4个 worker
php artisan octane:start --workers=4
ab -n 100 -c 100 http://localhost:8000/
hyperf qps
ab -n 100 -c 100 http://localhost:9501/
IO 对比
先看我表的总数据量
laravel 的数据库请求代码
Route::get('test', function () {
return \Illuminate\Support\Facades\DB::table('kol_analysis_labor_costs')->first();
});
curl 测试接口
开始压测
ab -n 100 -c 100 http://localhost:8000/test/
hyperf 代码
Router::get('/test', function() {
return \App\Models\KolAnalysis\KolAnalysisLaborCost::query()->first();
});
开始压测
ab -n 100 -c 100 http://localhost:19501/test
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: