perf(docker): OPcache revalidate 調校 + composer 重裝條件修正 + nginx healthcheck 修復
Run Tests / test (pull_request) Successful in 1m56s
Run Tests / test (pull_request) Successful in 1m56s
實測修正根因:fpm 的 OPcache 本來就啟用(初版診斷是 CLI 假象), 真凶是 revalidate_freq=2 在 Windows bind mount 上每 2 秒重新 stat 全部腳本——窗口內 0.23s、窗口外 2.5s。 - local.ini:revalidate_freq 2→30、memory 192M、max_files 20000 (程式碼變更最多 30s 生效,立即生效用 kill -USR2 1 平滑重載) - entrypoint:composer 重裝改用 lock 內容比對,git 分支操作不再 觸發開機重裝(原 mtime 比對造成數分鐘 502 窗口) - healthcheck:localhost→127.0.0.1(busybox wget 先解析 ::1 而 nginx 只 listen IPv4,導致永遠 unhealthy) 驗收:穩態 0.20~0.27s(修復前 2.3~2.5s,約 10 倍);nginx healthy。 量測數據已寫回優化計畫文檔。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -60,7 +60,8 @@ services:
|
||||
app:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
|
||||
# busybox wget 對 localhost 會先解析到 IPv6 ::1,但 nginx 只 listen IPv4,須用 127.0.0.1
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
Reference in New Issue
Block a user