Ubuntu Tips
Practical notes on provisioning, tuning and hardening Ubuntu servers.
This site collects the parts of running Ubuntu servers that are easy to get subtly wrong: tuning values that only matter under load, hardening steps that are worth doing once, and the occasional script that saves an afternoon.
34 posts so far. Everything is Markdown in a git repository.
New here? Start with the setup-script guide or why this site is static.
Pinned: One idempotent script for the whole Ubuntu web stack
Angie, PHP-FPM, MariaDB, Valkey and Elasticsearch from a single Bash entry point: every command, option and safety rule in one place.

Centrifugo at forum scale, loopback only
My setup script now installs Centrifugo, the realtime server my XenForo add-on uses for live posts, typing and presence. It is a verified release binary on loopback, in a unit that scores 1.1 in systemd-analyze, behind one exact nginx location with small tunnel buffers. A load test to 10,000 sockets set the defaults, and a run to 50,000 showed why the old default was wrong.

Plain, BOLT, PGO or both on an AMD EPYC (Zen 1)
A second run on the Zen 1 machine, with four builds of PHP 8.6.0 and the first run's two caveats fixed. PGO alone was fastest at +6.1 to +8.4 % and won all 20 comparisons. BOLT from plain samples gave +4.3 to +5.0 % on its own but made PGO slower, and the CLI still lost 4.8 % on bench.php, so the CLI gets built without the profile.

PGO where BOLT cannot run: PHP 8.6 on an AMD EPYC (Zen 1)
My setup script optimises PHP's code layout with BOLT, but BOLT needs branch records that older AMD CPUs such as Zen 1 don't have, so on those machines PHP gets no layout optimisation at all. Profile-guided optimisation trained on XenForo traffic filled the gap: +6 to +9 % requests per second on an EPYC 7401P, with one catch for the PHP CLI.

BOLT, PGO or both for PHP on a Xeon
I built PHP 8.5.13 four ways on the Xeon test host: plain, with BOLT, with clang PGO, and with both. BOLT and PGO each give about +7 % on uncached XenForo pages, but PGO on top of the BOLT build my setup script already ships adds only -1 to +2.4 %, so it stays out where BOLT runs.
