Commit Graph

10 Commits

Author SHA1 Message Date
Austin McKinley fc750703ac bskyogcard: downscale avatars before rendering
The card routes fetch each avatar from cdn.bsky.app/img/avatar/,
which serves up to 1000x1000. Cards never display avatars above
~210px, but satori parses and resvg rasterizes images at intrinsic
size: ~4MB of decoded native RGBA per avatar per render, up to 7
avatars per starter-pack card, and satori's 500-entry image LRU
retains the oversized data URIs. Under sustained traffic the native
churn and allocator fragmentation grow RSS unbounded and the service
OOMs against its 2Gi limit roughly hourly (observed in prod: ~20
OOMKills/day/pod for weeks).

Resize fetched avatars to 256px max with sharp before handing them
to the render pipeline. Decoded pixel volume drops ~15x; rendered
output is visually identical since display sizes never exceed the
resize cap. libvips' operation cache is disabled since unique-image
traffic never hits it.

Load-tested with 74 real starter packs (6 rounds, concurrency 8):
peak RSS 1441Mi -> ~1000Mi, JS heap 130-160Mi -> 45-70Mi, and
late-round RSS flattens instead of compounding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 23:07:28 -07:00
DS Boyce 651a3f8af4 Upgrade pnpm to 11.10.0 (#11075) 2026-07-06 13:08:47 -07:00
Samuel Newman c96d63fa5f [Chat] Update bskyogcard lexicon version (#10871) 2026-06-11 09:34:18 -07:00
DS Boyce c52231a449 Update handling of join link previews (#10798)
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
2026-06-09 07:23:33 -07:00
Samuel Newman 6432c925c2 [Chat] Add OpenGraph card for chat invite links (#10629) 2026-05-28 10:22:49 -03:00
Samuel Newman f527b35244 Add avatar-bubbles endpoint to bskyogcard (#10327)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: rafaeleyng <rafaeleyng@gmail.com>
2026-05-12 13:54:00 -03:00
DS Boyce 6f4ae14f36 Update to Node.js v24 (#10419) 2026-05-05 11:51:42 -07:00
Austin McKinley 0ddd09eb9b add metrics middleware to ogcard service 2025-09-22 10:20:05 -07:00
devin ivy 49396451ec bskyogcard: support emoji, more languages, long starter pack names (#4668) 2024-06-27 13:02:29 -04:00
devin ivy 51f5e6bf90 Bsky link card service (#4547)
* setup bskycard

* quick proof of concept for png card generation

* bskycard: use jsx

* bskycard: 3x5 profile layout

* bskycard: add butterfly overlay

* bskycard: tidy

* bskycard: separate and reorganize

* bskycard: tidy

* bskycard: tidy

* bskycard: tidy

* bskycard: poc of transparent overlay and box shadow

* bskycard: reorg impl into src/ directory

* bskycard: use more standard app structure

* bskycard: setup dockerfile, fix build

* bskycard: support for x-origin-verify

* bskycard: card layout, filter images based on labels

* bskycard: tidy

* bskycard: support cluster mode

* bskycard: handle error fetching starter pack info

* bskycard: tidy

* bskycard: fix leak on failed image fetch

* bskycard: build workflow

* bskyogcard: rename from bskycard

* bskyogcard: fix some express plumbing

* bskyogcard: add cdn tags, tidy
2024-06-20 17:45:52 -04:00