perf: 优化 API 并发、缓存与容器运行性能 - #67
Open
WangBen137 wants to merge 3 commits into
Open
Conversation
WangBen137
marked this pull request as ready for review
July 23, 2026 08:36
Collaborator
|
changelog的markdown需要删一下 |
Author
|
好的,正在处理 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
本 PR 针对项目中聚合接口请求串行、公共数据重复拉取以及容器运行时配置不足的问题进行优化。在保持现有路由和响应结构不变的前提下,降低接口延迟、减少上游请求次数,并提升异常情况下的稳定性。
主要改动
并发请求优化
Game::record()的 10 个独立上游请求改为批量并发执行,最大并发数为 5。Game::player()的角色资料与三类货币请求改为并行执行。/game/price在recent=1时的历史价格请求改为批量并发执行。缓存优化
/game/config增加 300 秒缓存。/game/items增加 300 秒缓存。Tools控制器依赖的物品集合增加 3600 秒缓存,降低控制器初始化开销。稳定性优化
Docker 优化
文档
CHANGELOG.md,记录本次性能、稳定性和部署相关变更,并补充近期版本历史。性能验证
以下为本地环境测试结果,仅供参考:
/game/config/game/items5 并发测试结果:
/game/config:约 166 req/s,0 失败。/game/items:约 179 req/s,0 失败。验证情况
composer.lock不同步警告除外)。兼容性说明
##声明:本次PR使用ai辅助编写