New age of scaling

3. Burst traffic queues inside PHP

ScaleArchitect · Scaling RCA · 12 October 2026 · 3 of 4

200-user repeat → 487 of 500 planned → 700-user synchronized burst · four warm instances

Test window: 12 October 2026 · All times UTC · Root causes, proposed fixes and the next scaling gate

Scaling decision

NEXT TEST · Validate worker capacity The origin saves every received action write in the three full-flow runs, but response tails grow during bursts. Cloud Run admits 150 concurrent requests per instance while PHP-FPM serves only 50. CPU is not the immediate saturated resource.

Next move: Run one controlled worker/admission experiment at 700 users. Instrument the PHP queue and preserve the browser-level failures in the acceptance criteria.

700-user origin p95
1.56 s
All origin requests, including static assets
Admission / PHP workers
150 / 50
Per container · dynamic PHP pool
Peak application CPU
19%
Database CPU peaks at 20%

The burst exposes waiting before CPU saturation

Larger synchronized flows produce longer server tails

Scenario comparison, not a fixed-configuration capacity curve: the 200 repeat admits 50 requests per instance; the later runs admit 150. Each keeps four warm instances. E09–E11.

Run · UTCActual / planned usersOrigin requestsSaved action writesOrigin p95Admission / workers
13:19 repeat200 / 20012,6731,363498 ms50 / 50
14:20487 / 50030,9253,3331,412 ms150 / 50
15:18 burst700 / 70048,4614,7331,563 ms150 / 50

Thirteen load generators fail before reaching the application in the 500-user plan, so the actual count is 487. The earlier 09:28 run of 200 users does not reach item submission and is not the full-flow baseline. At 700, 4,733 received action writes succeed, but the log contains 699 item-submission writes: received-write success is not proof that every intended user step completes.

Root cause and proposed experiment

F07

The admission limit is three times the PHP worker pool

P1 · Confirmed
Owner DevOps + runtime ownerConfidence Pool limit + configuration + latencyEvidence E09, E10, E11

Impact. A request can enter the container but still wait for a PHP worker. Raising the platform concurrency increases the work queued inside the same unchanged pool.

Root cause

The image uses a dynamic PHP-FPM pool capped at 50. At the 700-user opening all four instances reach that limit, while Cloud Run allows 150 concurrent requests into each container.

Evidence

Adapted, redacted excerpt · application names, fields, paths and response labels are illustrative aliases.

WARNING: server reached pm.max_children setting (50)

At the opening, app CPU is about 11%. Peak app CPU is 19%, memory 18% and DB CPU 20%. The short resource-activation write stays near 59–69 ms p95 across runs while heavier endpoints grow. These observations support worker waiting; sampled utilization cannot exclude every short spike.

Proposed fix

Start with the lower-risk experiment: keep 50 workers and align admission to 50, leaving instance count and test timing unchanged. Collect queue depth. If that merely moves waiting upstream, evaluate the larger ready pool in separate stages rather than changing memory, mode and workers together.

Experiment A · proposed change

Adapted, redacted excerpt · application names, fields, paths and response labels are illustrative aliases.

  pm.max_children = 50
- Cloud Run concurrency = 150
+ Cloud Run concurrency = 50
  instances = 4
  repeat the same 700-user synchronized flow

A configuration experiment, not a promised speedup. Compare all layers; fewer admitted requests can move the queue rather than remove it.

Experiment B · staged revisions after memory sizing

Adapted, redacted excerpt · application names, fields, paths and response labels are illustrative aliases.

1. Provision measured memory headroom; keep dynamic / 50 workers / admission 50
2. Change only pool mode: static / 50 workers / admission 50
3. Change only worker count: static / 150 workers / admission 50
4. Change only admission: static / 150 workers / admission 150

Retest each revision at the same 700-user flow. If memory provisioning also changes vCPU, treat stage 1 as a new resource baseline. Do not place 150 workers on the existing 2-GiB container: the source estimates ~3 GB at ~20 MB each; measure actual peak memory before sizing.

Risk and rollout

More resident workers can exhaust memory or overload the database. Lower admission can increase platform waiting or refusals. Do not change workers, memory, instance count and recording timing together; that loses causal attribution.

Retest and acceptance

Repeat the same 700-user burst after one change. Compare listen-queue depth, active/idle workers, request latency, memory, origin errors and expected business writes. Set latency targets with the owner before the run. Keep cold-start readiness as a separate gate.

Resource headroom points to the worker queue

Peak utilization by scenario; peaks are not necessarily simultaneous. This is supporting evidence, not proof that a larger worker pool is safe.

F08

Repeated SIGKILLs need a sender, not an assumption

P2 · Cause unresolved
Owner Runtime ownerConfidence Observed; causal hypothesis openEvidence E10, E11

Impact. Worker turnover can add jitter and obscure a burst diagnosis. It does not, by itself, establish a container crash or an out-of-memory failure.

Root cause

The signal sender is not identified. Dynamic pool resizing or CPU-allocation behavior is a hypothesis. There is no basis to declare the kills harmless or to carry the small-container OOM explanation into this run.

Evidence

Worker SIGKILL counts are 37, 176 and 342. At 700 users, 85 occur after active load at 1–7 requests per minute and 12–14% memory. The day-wide log search contains no container memory-limit entries, PHP-FPM request-termination timeout messages or master restarts.

Proposed fix

Enable process-correlated request logging and a locally restricted PHP status endpoint; capture queue and active-worker state through the burst. Temporarily enable pool debug logging for a controlled test. Then compare static-pool and CPU-allocation revisions one at a time.

PHP-FPM · proposed diagnostic settings

Adapted, redacted excerpt · application names, fields, paths and response labels are illustrative aliases.

access.log = /proc/self/fd/2
access.format = "%{%H:%M:%S}t pid=%p %m status=%s %{mili}d ms %{kilo}M KB %C%%"
pm.status_path = /status/runtime
request_slowlog_timeout = 2s
slowlog = /proc/self/fd/2

Adapted from E11: request-target logging is intentionally omitted. Restrict status to local monitoring and review slow-log fields before enabling collection.

Risk and rollout

Debug logging adds volume; request paths can contain credentials. Limit the diagnostic window, control access and retention, and scrub sensitive request data.

Retest and acceptance

Correlate the killed PID with its last request, memory and pool-management event. Identify the sender or isolate a reproducible mechanism before marking this finding closed.

F09

Zero origin 5xx does not mean a clean browser journey

P2 · Browser failures remain
Owner Frontend + edge ownerConfidence Browser vs origin scopesEvidence E11

Impact. Users can still see missing assets or failed connections while the origin dashboard looks green.

Root cause

Four API connections close and two static requests return 502 only in browser evidence, without matching Cloud Run entries. The edge is a candidate, not a proven cause. A separate image is absent from the application bundle.

Evidence

The 700-user origin log has zero 5xx/429 and 2,413 missing-image 404s. Separately, browser evidence contains six connection/static failures with no matching origin entries. Browsers count 4,882 missing-image responses including cached ones. These counts must not be added or relabeled as affected users.

Proposed fix

Restore the missing image. Correlate the six browser failures with edge logs and timings, including connection closure versus HTTP status. Keep edge and origin failures separate in the report.

Acceptance coverage · proposed change

Adapted, redacted excerpt · application names, fields, paths and response labels are illustrative aliases.

- Pass when origin 5xx = 0
+ Check origin errors, browser network failures and missing assets
+ Check expected submitted actions and business state

Test-acceptance specification; no claim that the edge cause is already identified.

Risk and rollout

A cached 404 can survive a bundle fix. Verify the asset at the browser observation point, not just inside the container.

Retest and acceptance

The same flow has no unexplained browser network failures, the image loads correctly and expected writes match the users who reach each action. Only then consider the next load step.