My goal:
Keep using the new app builder on an actively developed React app without opening it in the builder taking down our backend pods. Ideally that means a supported way to pack or compact an app's git storage, or confirmation that packing or caching is planned.
Issue:
Opening one of our React apps in the new app builder overloaded both main-backend pods. They failed their liveness probes and Kubernetes restarted them at the same time, so users got 503s for about 4 minutes.
The app's git storage in S3 is all loose objects and has never been packed:
[rr.git_storage] Client created looseObjects=2615 packFiles=0 refs=66
[rr.git_storage] Loaded repo from blob storage looseCount=2615 looseBytes=2.6MB packCount=0 looseMs=22662
The effective git config disables housekeeping:
gc.auto=0
maintenance.auto=false
receive.unpacklimit=1000000
receive.autogc=false
The app itself is only about 356 files (about 2 MB), so most of those objects are history: version history and builder branches.
Each GET /api/ai/rr/git/v2/apps//files reloads the whole repo from S3, one GET per object, and nothing seems to be cached between requests. One load takes 7β13s. The builder sends several of these requests at once, and with 3β4 running on the same pod each took 22β56s. While that runs, the pod is too busy to answer /api/checkHealth, so the liveness probe kills it. The builder's retried requests then do the same to the other pod.
The repo grows with every save and builder session, so this will keep getting worse for any app under active development.
Retool version & hosting setup:
- Self-hosted 4.34.4-stable (tryretool/backend)
- AWS EKS, Helm chart, 2 main-backend replicas (4 CPU / 8 GiB limit each)
- Retool database: RDS PostgreSQL (db.m5.large)
- New app builder git storage: S3 (RR_DEFAULT_S3_*)
Error message(s) or screenshots:
@smithy/node-http-handler:WARN - socket usage at capacity=50 and 100 additional requests are enqueued.
"message":"Health check error","err":{"message":"Database connection timed out."}
Liveness probe failed: Get "http://:3000/api/checkHealth": context deadline exceeded
Container main-backend failed liveness probe, will be restarted
What I've tried so far:
- Ruled out the database. RDS was idle throughout (about 6% CPU, sub-millisecond latency, around 115 connections), so the "Database connection timed out" health check error comes from the backend being overloaded, not from Postgres.
- Ruled out memory. The pods were using about 3 GiB of their 8 GiB limit, and nothing was killed for running out of memory.
- Traced the restarts to the /files requests through request logs and [rr.git_storage] timings.
- Checked the stable (4.34.5, 4.34.6) and edge (up to 4.66) release notes and found nothing about packing or caching the builder's git storage.
Questions:
- Is there a supported way to pack or compact an app's git storage, or to prune old history?
- Are there plans to pack repos (periodically, or on save), or to cache a loaded repo per pod?
- Is there a setting to limit how many of these repo loads run at once, or to raise the S3 client's connection limit?
- Until then, is there a recommended workaround other than recreating the app?