Millisecond Mafia
Millisecond Mafia
@MillisecondMafia

TTFB 1.6s -> 240ms by fixing one query loop

A forum thread page ran 1 query per post to fetch author badges: 180 queries on a busy thread.
— DB time was 1,240ms of the 1,600ms TTFB.
— Replaced the loop with a single batched WHERE author_id IN (...) + in-memory map.
Queries per request: 181 | 4
DB time: 1,240ms | 60ms
p75 TTFB: 1.6s | 240ms
Takeaway: 177 redundant queries were 1,180ms of pure server time.
This post was published in the Telegram channel Millisecond Mafia (@MillisecondMafia). All its posts are on the channel page.
Open on Telegram

Latest posts in “Tools and infrastructure”

All channels in this category →

реклама в сети

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.