hyperf qps 与 laravel10 + octane qps 对比

laravel10 + octane

hyperf qps 与 laravel10 + octane qps 对比

laravel 10 qps

使用 octane 启动 laravel, 开 4个 worker

php artisan octane:start --workers=4

hyperf qps 与 laravel10 + octane qps 对比

hyperf qps 与 laravel10 + octane qps 对比

ab -n 100 -c 100 http://localhost:8000/

hyperf qps 与 laravel10 + octane qps 对比

hyperf qps

ab -n 100 -c 100 http://localhost:9501/

hyperf qps 与 laravel10 + octane qps 对比

hyperf qps 与 laravel10 + octane qps 对比


IO 对比
先看我表的总数据量

hyperf qps 与 laravel10 + octane qps 对比

laravel 的数据库请求代码

Route::get('test', function () {
    return \Illuminate\Support\Facades\DB::table('kol_analysis_labor_costs')->first();
});

curl 测试接口

hyperf qps 与 laravel10 + octane qps 对比

开始压测

ab -n 100 -c 100 http://localhost:8000/test/

hyperf qps 与 laravel10 + octane qps 对比

hyperf 代码

Router::get('/test', function() {
    return \App\Models\KolAnalysis\KolAnalysisLaborCost::query()->first();
});

hyperf qps 与 laravel10 + octane qps 对比

开始压测

ab -n 100 -c 100 http://localhost:19501/test

hyperf qps 与 laravel10 + octane qps 对比

本作品采用《CC 协议》,转载必须注明作者和本文链接
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 17

hyperf 的 worker 数是多少

1年前 评论
晏南风 (楼主) 1年前

明天把 io 性能对比加上

1年前 评论
kis龍 1年前

航母和驱逐舰比速度

1年前 评论
nff93

看过 hyperf,怎么说呢,速度是提升上来了,但是已经脱离优雅了

1年前 评论

octane 够用了

1年前 评论

hyperf 默认配置 helloworld qps 不到 1 万不正常,我 2 核 2G 的阿里云服务器测试都过 2 万 qps

1年前 评论

:joy:

Laravel 的 Session 状态是开启还是关闭?

1年前 评论
oliver-l 1年前
陈先生 (作者) 1年前
GDDD

webman 请求出战

1年前 评论
晏南风 (楼主) 1年前
zjason 1年前
GDDD (作者) 1年前

应该是 hyperf 默认开启数据库连接池了吧,不开连接池对比一下? :joy:

1年前 评论