Benchmarking PHP 8.6 vs 8.5 vs 8.4 on Apple Silicon: Native PHP-FPM Sockets vs Docker Desktop VirtioFS
Reproducible Apple Silicon macOS benchmark comparing idle RAM, PHP CLI startup latency, and Laravel Artisan execution across native PHP-FPM Unix sockets vs Docker Desktop VirtioFS.
Why File-Heavy PHP Frameworks Feel Slow in Docker on macOS
Laravel, Symfony, and WordPress load hundreds to thousands of PHP files per HTTP request (via Composer's autoloader, Blade/Twig caches, and vendor trees). On Linux, Docker bind mounts talk directly to the host kernel VFS. On macOS, Docker Desktop must cross a Linux VM boundary (VirtioFS / Apple Virtualization Framework) on every stat() and file open — while reserving gigabytes of unified memory even when idle.
Running native macOS Darwin binaries (Nginx + isolated PHP-FPM Unix sockets per PHP minor version) eliminates the VM translation layer completely while letting PHP 8.1 through 8.5 (and Homebrew PHP 8.6) run side-by-side.
Reproducible 3-Metric Benchmark (Run on Your Own Mac)
Instead of taking anyone's marketing chart on faith, we published a read-only MIT-licensed bash benchmark script you can run directly inside any local Laravel project on Apple Silicon (M1–M4) or Intel Macs:
curl -fsSL https://stratosapp.dev/tools/macos-laravel-stack-benchmark.sh | bash -s -- .
The script measures three reproducible metrics on your exact machine without changing a single file:
- Idle Stack Memory (RSS MB): Compares native
nginx,dnsmasq, andphp-fpmprocess memory against active Docker Desktop / virtualization VM processes. - 20-Iteration PHP CLI Cold Startup: Measures raw binary boot overhead (
php -r "echo 1;") across your installed PHP runtime. - 10-Iteration Laravel Artisan Boot Time: Measures real autoloader + service container boot (
php artisan --version) on native APFS vs inside a bind-mounted container.
What Changes Between PHP 8.4, 8.5, and 8.6 on Local macOS Stacks
| Layer | Docker Desktop / Sail (macOS) | Native Swift + Isolated PHP-FPM Sockets (Stratos) |
|---|---|---|
| Filesystem I/O | Cross-VM VirtioFS mount overhead | Direct native macOS APFS |
| Multi-PHP Switching (8.1–8.6) | Rebuild image or swap containers | Simultaneous per-version Unix sockets (fpm/*.sock) |
| Idle RAM Footprint | Typically 2–6 GB VM allocation | Lightweight native daemons (workload-dependent) |
| Local AI / MCP Debugging | Manual container exec wrappers | Built-in loopback MCP bridge (127.0.0.1:9921/mcp) |
Inspect the Open-Source Companion Toolkit
All three read-only macOS diagnostic and migration scripts (SSL Doctor, Stack Benchmark, and Sail-to-Native Migrator) are MIT-licensed on GitHub at khorshedobs/macos-php-laravel-toolkit. When you want the full stack — Nginx, isolated PHP-FPM pools, Keychain .test HTTPS, Visual Tinker REPL, MailCatcher, DumpServer, and 1-click Cursor/Claude MCP — managed automatically in native Swift:
Download Stratos Free for macOS → Try Free Laravel MCP Config Generator →
Replace $296+/yr of macOS Dev Subscriptions with Stratos
Start free forever with native Nginx, PHP 8.1–8.5, .test HTTPS, Xdebug 3, and read-only MCP schema tools—or lock in the Founder Lifetime license (3 Macs) for $71.20 (reg. $89) with code BFCM20.