Asset performance on large and remote containers
维护者通常 1 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- backend, performance
调研方向
This is a parent issue covering asset listing and meta generation, with related work in AssetContainerContents::all(), Asset::exists(), Asset::generateMeta(), Imaging\Attributes::from(), and InsertMultipleJob. Start by following the linked issues and pull requests, especially #15610, #15609, and #15934, then measure the remaining cases on Statamic 6.x with those changes applied. Done means identifying which unchecked performance problems remain and addressing them as separate changes.
由索引模型根据 Issue 内容生成。
描述
Bug description
Parent issue tying together the open asset performance reports and the PRs that address them. They come down to two separate root causes, which overlap in #14061.
A. Everything goes through the full container listing
AssetContainerContents::all() caches the whole recursive Flysystem listing of a container, and most asset operations load all of it, even to answer a question about one file. With the Stache watcher enabled ttl() returns 0, so the listing is rebuilt constantly, which on a remote disk means repeated LIST calls.
- #15608 — the cached listing includes every
.metasidecar, roughly doubling its size. PR: #15610 - #15607 —
Asset::exists()loads the whole listing to check one file. PR: #15609 (stacked on #15610) - #6495 — slow pages with many assets. Much of the Stache query cost reported there has since been addressed (#13952, #15669, #15877, #15894), and #15609 covers the
exists()/metaExists()scan. Needs re-measuring on6.xwith #15610 and #15609 applied; close if flat, otherwise port what remains of thestache-tweaksbranch mentioned there (storing prefixed keys inIndexso they aren't rebuilt per query). -
ttl()of0with the watcher on causes repeated listings on remote disks (reported in #14061, also likely behind #11949). No PR yet.
Related: #11998 moves meta off the container disk entirely.
B. Generating meta downloads the whole file
Asset::generateMeta() needs dimensions/duration, and on a remote disk that means pulling the full object.
- #8626 — large video on S3 ties up workers. PR: #15934 (ranged reads for audio/video)
- Images are still copied whole to read their dimensions (
Imaging\Attributes::from()). No PR yet. - #14061 —
InsertMultipleJobregenerates meta for every asset when the meta cache is empty, times out, retries and downloads everything again. Needs the two items above plus thettl()item in A, and the retry loop looked at. No PR yet.
How to reproduce
See the individual issues. The common setup is a container with tens of thousands of files, most visibly on S3.
Logs
No response
Environment
Statamic 6.x. See the individual issues for specifics.
Installation
Existing Laravel app
Additional details
Suggested order: #15610, then #15609, then re-measure #6495. #15934 is independent of group A. The remaining unchecked items without a PR would each be their own small PR.
- 主要语言
- PHP
- 星标
- 4.9k
- 派生
- 647
- 平均合并
- 1 天 45 分钟
- 30 天内合并 PR
- 221
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
statamic/cms 的其他 Issue
-
forms ui
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
accessibility
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
antlers
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
Nav: link to the site root with an anchor (/#section) gets is_parent on every page可能已有人在做 @duncanmcclean 今天认领。 未关闭navigations
难度 2/5 1-3 小时 新手友好度 35/100
维护者通常 1 天内回复
-
Multiple Choice and Checkboxes no longer offer "Inline", but the default views still use it可能已有人在做 @duncanmcclean 今天认领。 未关闭forms
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
sync-en
难度 1/5 1 小时以内 新手友好度 86/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
taskforcesh/bullmq#5238 ·
维护者通常 1 天内回复
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects it可能已有人在做 @bfs2021 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
Automattic/jetpack#55517 ·
维护者通常 1 天内回复