Skip to content

Commit ec012d6

Browse files
jirhikerclaude
andcommitted
fix(deploy): raise instance class to F4_1G to stop OOM instance churn
Production ran gunicorn -w 8 on an F4 (1 GB) instance. Eight workers each importing the full stack (sqlalchemy + geoalchemy2 + shapely + cloud-sql connector + pygeoapi) exceeded 1 GB, so App Engine terminated processes for "using too much memory" ~44x per 3h and cycled workers continuously (304 "Booting worker", 297 SIGTERM in a 3h window). With the single min-instance constantly reborn, every request hit a booting instance and re-cold-loaded the app -- site-wide degraded latency even at low traffic. Raise instance_class F4 -> F4_1G (2 GB) so the eight workers fit, per App Engine's own "consider a larger instance class" guidance. Keeps the -w 8 / max_concurrent_requests: 6 scale-out tuning from the prior starvation fix intact. Template is shared; staging/testing (-w 4, scale-to-zero) gain harmless headroom at negligible idle cost. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 37ba8e7 commit ec012d6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/app.template.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ service: ${SERVICE_NAME}
22
runtime: python313
33
entrypoint: ${ENTRYPOINT}
44
service_account: "${CLOUD_SQL_USER}.gserviceaccount.com"
5-
instance_class: F4
5+
# F4_1G (2 GB) not F4 (1 GB): the entrypoint runs gunicorn -w 8, and eight
6+
# workers each importing the full stack (sqlalchemy + geoalchemy2 + shapely +
7+
# cloud-sql connector + pygeoapi) exceeded 1 GB. App Engine logged "using too
8+
# much memory and was terminated" ~44x/3h and cycled workers continuously
9+
# (304 "Booting worker", 297 SIGTERM in 3h), so every request re-cold-loaded.
10+
instance_class: F4_1G
611
inbound_services:
712
- warmup
813
automatic_scaling:

0 commit comments

Comments
 (0)