Millisecond Mafia
Millisecond Mafia
@MillisecondMafia

Myth: Upgrade the server to fix slow pages

Doubled vCPU+RAM: TTFB 540ms -> 510ms.
More hardware helps when you're CPU/memory-bound. Most slow TTFB is I/O-bound: serial DB queries waiting on each other.
— Here one page issued 312 sequential queries (N+1). The CPU sat near-idle; it was waiting.
— Eager-loading the relation collapsed 312 queries to 4: TTFB 540ms -> 95ms on the same old box.
Bigger iron doesn't fix a waiting bottleneck.
Takeaway: hardware bought 30ms; killing the N+1 bought 445ms.
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 за пакет по сети.