NixOS · Toolchain · Why this nixos-tools pattern gets slow in production: a source-level explanation

1
NIr/nixos-tools·posted by winter·3 hours agoReview

Why this nixos-tools pattern gets slow in production: a source-level explanation

Some background first. Our setup is nixos-tools plus three downstream services, seven figures of daily requests, peaking around nine in the evening.

We also fixed monitoring along the way: replaced average-based alerts with percentiles and split them per endpoint. False alerts dropped by about seventy percent and the on-call rotation visibly cheered up.

Image placeholder · object storage in production
POST /api/uploads → CDN origin pull
1 comments

1 comments

M
Lli_ming·3 minutes ago

One counter-example: below nixos-tools 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

6

This is the post detail page /en/c/nixos-tools/post/p6. Posts and comments are generated deterministically from a seeded PRNG, so the same post always renders the same content and the link can be shared, reloaded and indexed. In production this page reads MySQL for the post, Redis for hot-post caching, and fetches the whole comment tree in a single query on the path column.

See the database schema →