Comments (4)
我刚刚使用本地redis服务试了一下:
//代码
for ($i = 1; $i < 200; $i++) {
Redis::get('aa');
}
return response('ok');
//8进程压测
Concurrency Level: 100
Time taken for tests: 8.637 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 122000 bytes
HTML transferred: 2000 bytes
Requests per second: 115.78 [#/sec] (mean)
Time per request: 863.724 [ms] (mean)
Time per request: 8.637 [ms] (mean, across all concurrent requests)
Transfer rate: 13.79 [Kbytes/sec] received
我这个是本地redis,你要不是本地redis,成绩肯定会更差.
from webman.
我刚刚使用本地redis服务试了一下:
//代码 for ($i = 1; $i < 200; $i++) { Redis::get('aa'); } return response('ok');
//8进程压测 Concurrency Level: 100 Time taken for tests: 8.637 seconds Complete requests: 1000 Failed requests: 0 Total transferred: 122000 bytes HTML transferred: 2000 bytes Requests per second: 115.78 [#/sec] (mean) Time per request: 863.724 [ms] (mean) Time per request: 8.637 [ms] (mean, across all concurrent requests) Transfer rate: 13.79 [Kbytes/sec] received
我这个是本地redis,你要不是本地redis,成绩肯定会更差.
是的, 这个测试是 mac 下 docker 里的 redis server
测试过当前机器的redis server, 基本可以到 Requests per second: 220+ [#/sec] (mean)
from webman.
Redis很快,但是也有极限,普通服务器的Redis的QPS最高就大概10万QPS左右。
每个请求200次redis访问,10W/200 = 500QPS,所以这种200次Redis访问的业务任何语言、任何框架压测出来结果都是几百,没什么好聊的。
还有压测上正常linux服务器,不要用docker或虚拟机。压测记得加-k,否则很容易本地端口用光导致延迟影响结果。
这种巨慢的业务压测最好把 config/server.php里的reuse_port打开,让连接均摊到每个进程。
from webman.
Redis很快,但是也有极限,普通服务器的Redis的QPS最高就大概10万QPS左右。 每个请求200次redis访问,10W/200 = 500QPS,所以这种200次Redis访问的业务任何语言、任何框架压测出来结果都是几百,没什么好聊的。
还有压测上正常linux服务器,不要用docker或虚拟机。压测记得加-k,否则很容易本地端口用光导致延迟影响结果。 这种巨慢的业务压测最好把 config/server.php里的reuse_port打开,让连接均摊到每个进程。
明白了, 谢谢!
使用 golang 压了一下, mac 下没有相关配置优化的情况下, 效果也差不多:
from webman.
Related Issues (20)
- Need Help Getting Browser-Detect or Mobile-Detect to Work with Webman HOT 2
- 多级控制器方法名支持驼峰命名的处理办法,希望下个版本加入 HOT 2
- 变量名称错误导致控制台打印状态报错 HOT 2
- Disable view caching when using blade templates? HOT 1
- 我要集成gRPC服务
- 我发现Request获取get和post的格式不一致 HOT 1
- support\Request不支持依赖注入 HOT 2
- 依赖注入,适配symfony的依赖组入组件吗? HOT 1
- 关于单元测试的功能实现,phpunit HOT 1
- webman 启动时报错:Segmentation fault ,请问除了gdb,还有什么调试方案么?
- webman 使用php8.3.1, workerman v5 bate7 , 安装了swow扩展后读取配置文件一直报错 HOT 2
- 关于 Timer::add 的bug
- MongoDb的驱动能否修改最新的? HOT 2
- [bug] $request->action在控制器中不存在方法时该值始终返回小写 HOT 3
- [question] What do you use to generate these docstrings?
- Difficulty Deploying on Shared Hosting Without SSH or Shell Access
- 如何修改请求参数 HOT 1
- 如何做才可以不提示webman的启动参数 HOT 1
- Redis Prefix caused multiple deletion failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webman.