Case studies·Tools

Marginalia Search

Indie search from a living-room gaming PC

Viktor Löfgren’s Marginalia Search indexes tens of millions of documents from consumer hardware in his apartment — Java, nginx, and a refusal to need a datacenter budget to compete with the big indexes.

2021

COVID hobby, Pi-cluster roots

Side project · keyword search for the small web

Marginalia started during the pandemic as a project to pass time — an indie search engine prioritizing text-heavy, non-commercial sites. Löfgren built his own crawler and index instead of wrapping Google or Bing.

Early designs targeted a Raspberry Pi cluster, forcing thrifty engineering. That constraint shaped code that still runs lean even after migrating to bigger iron.

Lesson

Design for the smallest hardware you have. Inefficiency shows up fast when your “datacenter” is a Pi cluster.

2022

HN front page on one home PC

~2 searches/sec sustained (HN spike) · single consumer PC

When Hacker News discovered Marginalia, Löfgren’s “Against the Flood” post describes the moment: sustained load around two queries per second, half a million to a million visits — on a Ryzen 3900X with 128GB RAM humming in his living room next to a UPS.

No cookies except for his own admin tools, static HTML where possible, pages often under 10KB. A 2006-era router sat upstream. The ship floated because the design was thrifty, not because he bought cloud credits.

Lesson

Sessionless, cache-friendly pages are a scaling strategy. Most of your traffic does not need personalized server state.

2023–today

50M+ docs, growing pains on purpose

50M+ indexed documents (2023 blog) · ~218M known URLs in MariaDB

By late 2023 the index passed fifty million documents — up from ~28 million in February. Side-loading Stack Overflow alone accounted for much of the growth. Preconversion and transposition jobs that took twenty minutes needed tuning when mechanical disks fought for seek time.

Löfgren’s “Growing Pains” post is honest: MariaDB struggles at 218M URLs, ten-second page loads are a DoS vector, memory leaks need allocator swaps. He’d rather patch a home-built index than pay the “admittance fee” of hyperscaler architecture.

Lesson

Indie search is an optimization game, not a funding game. Publish the pain — users who care will Patreon the crawl budget.

Sources

Facts drawn from public engineering posts and interviews. Numbers are approximate where sources disagree — we're stack advisors, not historians.

Get the right stack for YOUR scale — not theirs

Marginalia Search's stack made sense for Marginalia Search. Yours won't — and copying theirs is how you end up with a $4k/month bill and three unused Kubernetes clusters.

Plan my stack — free