Posts tagged “Openssl”
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.

Dropping the packages: compiled nginx, PHP and Valkey, and what the migration tests broke
My setup script now builds nginx, PHP and Valkey from source and installs none of them from packages. Live servers migrate once, on --optimize. Testing that migration and a PHP downgrade chain found eight bugs, including a build log that grew to 1.7 TB. A day later, 1.22.1 dropped pre-compressed static files.

Compiling Valkey, and the BOLT flag that gave my binaries an executable stack
Valkey from source was 35 % slower until I stopped passing CFLAGS on make's command line. Then its unit refused the BOLTed binary, which exposed an executable stack in my compiled PHP and Angie too. Plus nginx vs Angie, compiled the same way.

Compiling Angie too, and the hardening my compiled PHP was missing
Angie compiled from source served cached pages 4-6 % faster; zlib-ng cut its gzip cost by a fifth. PGO, AutoFDO and a static glibc were measured; and the from-source php-fpm got back the stack protector and RELRO that upstream clang leaves off.

Why my from-source PHP was slower, and the one-line answer: ICU
A from-source php-fpm executed 9 % fewer instructions per page than a clang build using Sury's extensions, yet ran 1-2 % slower. The cause was ICU: the intl extension made the binary 102 MB and multiplied data-TLB misses by 4.5. Without it, the merged build is the fastest: +11 % on logged-in XenForo pages.

Three php-fpm builds side by side: Sury, clang + BOLT, and everything from source
My earlier compiled-PHP tests found nothing. Two flaws in my build harness were hiding the gain: GCC was built without its global registers, and BOLT was never tried. With both fixed, a BOLT-optimised php-fpm is 5-10 % faster on logged-in XenForo pages. Building every library from upstream as well added nothing measurable.

OpenLiteSpeed and LSCache against Angie for a large XenForo forum
A four-way shootout on a seeded XenForo forum: Angie with PHP-FPM and its FastCGI cache, the same with a clang-built PHP, and OpenLiteSpeed with LSAPI and the official LiteSpeed Cache add-on. Angie serves cached guests 16-23 % faster, members are a tie, and the add-on's documented setup shows logged-in members the guest page.

clang, PHP 8.4 and the missing zlib: the last round of compiled PHP
The final round of the compiled-PHP question: CentminMod's function alignment on its own, a clang build and PHP 8.4, with every module compiled from source. clang is the only build with a repeatable edge (+3 % on XenForo), 8.4 is slower than 8.5, and my earlier source builds were missing zlib.

Everything on: LTO, PGO and -march=native made PHP 8.5 slower
A follow-up to the four-build PHP test: turn on every CentminMod compiler option, add LTO and two-stage PGO trained on real XenForo traffic, and compile every module from source. The result is 5 to 10 % slower than the distribution package, not faster.

Is a compiled PHP faster? Four builds, one Xeon, and a JIT that makes the question moot
Sury packages, Ubuntu's archive, and PHP built from source with -O3 -march=native and only the modules XenForo needs. On a PHP-bound forum the difference was inside the noise, and the reason is the tracing JIT.
