Stackrig

Blog

How-tos and explanations for Linux, servers, databases and the cloud. Every how-to was run on a fresh machine first, and every piece says what it does not tell you.

measured our run on real machines model the simulator explained a concept, with one simulated example tested every command run by us on a fresh machine

Newest measured

Self-hosted LLM or API: when does a rented GPU pay off?

gpt-oss-20b on one rented L4, measured: what a million output tokens cost at 1 to 64 requests at once, and how busy the GPU must be to beat five per-token APIs.

1,008 output tokens per second one L4, gpt-oss-20b, 64 requests at once

  1. explained

    Why does fan-out make fast services slow?

    A request that waits for 100 parallel calls is as slow as the slowest of them: the arithmetic of Dean and Barroso's paper, and the same effect in a design you can run.

    63 % requests meet a slow call

  2. explained

    Why does p99 latency explode long before 100 % CPU?

    The queueing arithmetic for 1, 2 and 16 cores, what bursts do to it, our Postgres measurement, and the same curve in four designs you can open.

    921 ms p99 at 95 % CPU

  3. measured

    How many users can a $12 server handle? We measured it

    A $12-a-month VM with Nginx, Node.js and Postgres under virtual users: about 800 users at one second of think time, and a CPU throttle the guest does not show.

    800 users on a $12 server

  4. measured

    How many requests per second can one Postgres handle?

    One PostgreSQL on a 2-vCPU VM, measured: about 6,000 simple indexed reads per second at 100 % CPU, where p99 starts to climb, and how to estimate your own number.

    6,000 queries per second one Postgres, 2 vCPUs

  5. measured

    How big should your database connection pool be?

    A pool of 4 against a pool of 16 connections on the same Postgres, measured, and Little's law for sizing your own.

    4 connections enough for 2 vCPUs

  6. model

    Cache hit ratio: what 80 % vs 95 % means for your database

    The arithmetic of cache misses, and what a cold cache after a restart does to the database behind it.

    4× less database read load

  7. model

    Retry storms: why retries take your service down

    How retries multiply load, why a storm can outlive its trigger, and the fixes that work, shown in a design you can run.

    16× traffic from two retry layers

  8. model

    System design interview: the URL shortener, simulated live

    The classic interview design with its numbers simulated over a real day of traffic: what breaks first, at which load, and what it costs.

    3× traffic the API breaks first

  1. tested Ubuntu 24.04

    Could not get lock /var/lib/dpkg/lock-frontend on Ubuntu 24.04

    We started a second apt while a first one was installing on a fresh Ubuntu 24.04: it named who held the lock, waited, and went on by itself.

  2. tested Debian 13

    Package 'mysql-server' has no installation candidate on Debian 13

    We made apt’s “no installation candidate” for mysql-server on a fresh Debian 13, read what apt offers instead, installed it and logged in.

  3. tested Ubuntu 24.04

    Access denied for user 'root'@'localhost' on Ubuntu 24.04

    We made MySQL’s ERROR 1698 on a fresh Ubuntu 24.04, looked up how the account root is checked, and logged in with one command.

  4. tested Ubuntu 24.04

    Peer authentication failed for user "postgres" on Ubuntu 24.04

    We made “Peer authentication failed for user "postgres"” on a fresh Ubuntu 24.04, read why in the server's log, and logged in with one command.

  5. tested Ubuntu 24.04

    How to install Docker on Ubuntu 24.04

    We installed Docker Engine on a fresh Ubuntu 24.04 and kept each output: a first container, “permission denied” on the socket, the uninstall, and what stayed behind.

  6. tested Ubuntu 24.04

    How to install PostgreSQL on Ubuntu 24.04

    We installed PostgreSQL on a fresh Ubuntu 24.04 and kept what every command printed, from the first login and “Peer authentication failed” to removing it all again.

How closely does the live model agree with an exact simulation? See the accuracy report