Repository navigation
perf: enable OPcache and Hyperloop B - #13487
Conversation
Greptile SummaryThis PR enables and tunes PHP OPcache, applies the Hyperloop B HTTP runtime preset, standardizes shared connection pools on the coroutine-aware Swoole adapter, and corrects concurrent chunk-upload completion handling.
Confidence Score: 5/5The PR appears safe to merge, with the previous development OPcache issue fixed and no actionable new defect established. The development image now overrides production timestamp behavior with Important Files Changed
Reviews (5): Last reviewed commit: "fix(storage): finalize only after all ch..." | Re-trigger Greptile |
| opcache.memory_consumption=384 | ||
| opcache.interned_strings_buffer=32 | ||
| opcache.max_accelerated_files=65536 | ||
| opcache.validate_timestamps=0 |
There was a problem hiding this comment.
This configuration is inherited by the development image, where app/ and src/ are bind-mounted into a persistent PHP process. With CLI OPcache enabled and timestamp validation disabled, edits to cached PHP files are ignored until the process restarts, breaking the live-edit development workflow. Apply this setting only to immutable production images or override it for development.
Knowledge Base Used: Application bootstrap and runtime lifecycle
Prompt To Fix With AI
This is a comment left during a code review.
Path: docker/opcache.ini
Line: 6
Comment:
**Development Serves Stale Code**
This configuration is inherited by the development image, where `app/` and `src/` are bind-mounted into a persistent PHP process. With CLI OPcache enabled and timestamp validation disabled, edits to cached PHP files are ignored until the process restarts, breaking the live-edit development workflow. Apply this setting only to immutable production images or override it for development.
**Knowledge Base Used:** [Application bootstrap and runtime lifecycle](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/appwrite/-/docs/application-bootstrap.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
What does this PR do?
Enable Cloud's PHP OPcache configuration in the Appwrite image, including CLI caching, a 384 MiB cache and tracing JIT with a 128 MiB buffer. Production images disable timestamp validation. Development images enable timestamp validation with no revalidation delay so worker reloads pick up bind-mounted source changes.
Apply the HTTP adapter's Hyperloop B preset for coroutine hooks, FD-bound dispatch, send yielding and runtime tuning. Preserve Appwrite's configured worker count and 12 MiB payload/output limits. Select coroutine-aware Swoole connection pools in the HTTP entrypoint, through a fresh registry adapter per pool, including installations that still configure the legacy stack adapter; the stack adapter cannot wait when concurrent requests exhaust a pool.
Parallel chunk uploads finalize only after the merged metadata records every completed chunk write; files still being written must not count toward completion. They also check the completed file document under the existing lock before rejecting an empty chunk count. A concurrent finalizer can remove chunk files before another request counts them, which otherwise returns a spurious 500.
Test Plan
48ecaccecd533424f194dc925df0e32a1388f530: image build, static checks, security scanning, unit tests, E2E suites and benchmark.Related PRs and Issues
Matches the configuration in Appwrite Cloud.
Checklist