oot asset sweep exhausts a 256 MB VM when the bucket is empty
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, sqlite, typescript
- Área
- backend, infrastructure
Línea de trabajo
Start with run-cloud-boot.js, which spawns the sweep as a second Node process, and with put_file, where the upload body comes from openAsBlob. Reproduce on a 256 MB setup with an empty bucket and a few hundred MB of assets, then record per-process memory with ps -o pid,rss,args during the sweep. Done means the process that grows is identified, with a fix or a documented minimum VM size backed by those measurements.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
When the backup bucket is missing many assets, the boot-time sweep can exhaust a 256 MB Fly VM. The machine keeps running but stops answering: every request times out until the sweep finishes or the VM gets more memory.
Seen on sonjastojanovic after moving the app to another Fly org and switching to a new, empty Tigris bucket (see #233). The sweep had to upload 657 asset files, 314 MB in total, including videos up to 73 MB.
- Machine: shared-cpu-1x, 256 MB (209 MB visible to the VM), no swap.
- About 3 minutes after boot: 9 MB available, load average 3.8, no HTTP response within 30 seconds, and
fly sshsessions hanging. - Several uploads failed with
fetch failed. - The site was unreachable for about 11 minutes, until the VM was scaled to 512 MB. There, the remaining 284 files uploaded in 19 seconds while the site stayed responsive. Back on 256 MB with the bucket in sync, the site is fine.
What we know
#209 had a similar out-of-memory kill, and 8069ade fixed the cause found then: put_file read each file fully into memory. That fix is deployed here, and the upload path now looks streamed. put_file passes an openAsBlob body, and aws4fetch with service: 's3' sets X-Amz-Content-Sha256: UNSIGNED-PAYLOAD, so it never hashes or buffers the body itself. Buffering whole files in our own code doesn't explain this one.
During the sweep the VM runs three processes at once:
- the server
- the sweep, a second Node process that
run-cloud-boot.jsspawns - the Litestream sidecar, which in this case was also failing on every sync because of #233
Nobody measured memory per process before scaling up, so we don't know which one grew.
Next steps
- Reproduce with an empty bucket (or a new
BUCKET_NAME), a few hundred MB of assets including large videos, and a 256 MB VM. Watch memory per process during the sweep withps -o pid,rss,args. - Check whether Node's
fetchreally streams a file-backed Blob fromopenAsBlob, or holds large parts of it during the upload. - Check whether Litestream's memory grows while it retries the missing-LTX error from #233.
- Depending on what that shows: run the sweep inside the server process instead of a second Node process, cap the sweep's heap, defer large files, or document 512 MB as the minimum for sites with large videos and automated backups.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 148
- Merge medio
- 2 h 47 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de michael/editable
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
michael/editable#181 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de michael/editable
Issues similares
-
bug data-types
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
ClickHouse/clickhouse-js#1293 ·
Los mantenedores suelen responder en 1 día
-
area: middleware enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
agent/quality testing
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
Los mantenedores suelen responder en 1 día
-
GitHub registry install via `gh` credentials rewrites `\u0000`–`\u001f` escapes in source files to `^@`–`^_`Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
juspay/agent-distro#203 ·
Los mantenedores suelen responder en 1 día