Skip to content

Optimize image size and XMLTV runtime resources - #1

Merged
cerede2000 merged 1 commit into
mainfrom
agent/optimize-image-runtime
Jul 18, 2026
Merged

cerede2000 merged 1 commit into
mainfrom
agent/optimize-image-runtime

Conversation

@cerede2000

Copy link
Copy Markdown
Owner

What changed

  • make XMLTV imports memory-flat by streaming records through a disk-backed batch spool under /data
  • limit concurrent XMLTV workers to one by default and add content-hash smart-sync fallback
  • keep 7-Zip, uvloop, and httptools while removing bytecode and unused Uvicorn extras from the image
  • avoid loading detail-only programme fields in collection endpoints and remove the unused title B-tree index
  • cancel stale frontend searches and bound authentication attempt tracking
  • add an amd64 image-size budget of 185 MiB to CI

Why

Large or concurrent XMLTV imports retained two full Python representations while downloads and decompressed documents lived in a RAM-backed /tmp. This caused avoidable RAM and CPU spikes. The runtime image also embedded bytecode and unused server dependencies.

Measured impact

A 100,000-programme / 16 MiB synthetic feed dropped from 96.4 MiB peak traced Python allocations to 2.1 MiB. The disk spool was 12.7 MiB. A fresh production virtualenv dropped from 43 MiB to 41 MiB even before accounting for the 20.9 MiB of bytecode present in the published Linux layer.

Validation

  • backend: Ruff + format check + 129 tests
  • frontend: ESLint + 90 tests + production build
  • Alembic upgrade tested from revision 849e860670eb with existing data preserved
  • workflow and Compose YAML parsed successfully

@cerede2000
cerede2000 marked this pull request as ready for review July 18, 2026 14:17
@cerede2000
cerede2000 merged commit d7cc068 into main Jul 18, 2026
3 checks passed
@cerede2000
cerede2000 deleted the agent/optimize-image-runtime branch July 18, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant