
Sessenta contêineres em um servidor
Uma caixa bare-metal executa dezenas a centenas de contêineres Hoody. KSM e BTRFS dedup fazem o custo marginal próximo a zero.
Você está rodando uma migração de oito horas. Cinco pessoas querem ver o status sem consumir um slot de receiver nem interromper o stream. Anexe ?progress à URL do pipe. Quem abrir recebe um dashboard HTML ao vivo — bytes transferidos, velocidade atual, ETA, transições de estado. A migração roda à velocidade total, independente de quantos olhos estiverem assistindo.
?progress é uma leitura separada no caminho do pipe que escuta o estado da transferência sem reivindicar um slot de receiver. A migração não percebe. O navegador vê um dashboard HTML; o curl vê um feed SSE limpo.
She pastes the pipe URL with ?progress into her phone browser. The HTML dashboard appears instantly — state: waiting, 0% — no install, no login, no receiver slot consumed.
SSE pushes a state: streaming event. The progress bar snaps to 22%, bytes tick up, MB/s settles at 118. The dashboard updates itself every 250 ms without a single page reload.
She closes the tab. Her spectator connection drops. The migration doesn't notice — it was never in the data path. The sender and its one real receiver carry on.
She reopens the URL at sunrise. The dashboard shows a done event: 7.6 GB transferred, 8h 2m, no errors. Server-side state survives the refresh — latecomers always see the final line.
She forwards the URL to the team Slack. Three engineers open it and see the same done state. No status thread to close, no Grafana panel to un-star. One URL, five witnesses, zero interruptions.
# 1. Sender — eight-hour migration. Same as always.
tar czf - /var/lib/postgres | curl -T - "$PIPE/api/v1/pipe/migration"
# 2. Receiver — the only client that matters for backpressure.
curl "$PIPE/api/v1/pipe/migration" | tar xzf - -C /restore
# 3. Boss opens the URL on her phone. HTML dashboard. No setup.
# => https://pipe.hoody.com/api/v1/pipe/migration?progress
# 4. You want SSE for a Slack bot? Same URL, different Accept.
curl -N -H "Accept: text/event-stream" \
"$PIPE/api/v1/pipe/migration?progress" \
| grep -E '^event: (progress|state|done)'
# event: state \n data: ["state":"streaming","receivers":1]
# event: progress \n data: ["bytes":5046464512,"mbps":118,"etaSec":840]
# event: done \n data: ["bytes":8160000000,"durationSec":28800]Três tipos de evento SSE. state para transições (idle → waiting → streaming → complete), progress a cada 250ms enquanto bytes fluem (bytesTransferred, velocidade, ETA), done uma vez no final com estatísticas finais. Até cinquenta espectadores por caminho, TTL de conexão de trinta minutos, linger de trinta segundos pós-transferência para que retardatários vejam a linha de sucesso.
O mesmo endpoint ?progress serve uma aba de navegador, um pipeline curl e uma página de status que faz polling em segundo plano. Nenhum deles desacelera a transferência.
Bookmarks the URL on her phone. Checks twice a day.
HTML dashboard, no loginCurl SSE into a Slack webhook. One-liner status bot.
text/event-stream, same URLEmbedded in a public status page. Polls every 30 s.
0 receiver slots, full live stateWired to PagerDuty via the done event. Pings when finished.
event: done, one-shot triggerAssistir à migração tem URL própria. A migração não percebe.
Todo time tem um jeito de responder 'a quantas anda?'. A maioria desses jeitos custa um serviço para rodar, um dashboard para ligar ou um canal de chat para vigiar. Um query parameter na URL do pipe não custa nada disso.
Mande a URL. Pare de mandar updates.