Troubleshooting & Fixes• 3 min read
Why Laravel Sail & Docker Are Slow on macOS (And the Native Fix)
Fix slow page loads, high CPU usage, and VirtioFS file sync latency with Laravel Sail on Apple Silicon MacBooks.
The Truth About Docker Desktop on Apple Silicon
If you're using Laravel Sail on macOS, you've probably noticed that a simple GET / request that takes 2ms in production takes 150ms to 400ms on your brand-new M3 or M4 MacBook Pro. When running test suites (php artisan test), hundreds of tests take minutes instead of seconds.
Why Is Docker File Sync So Slow on macOS?
Docker is fundamentally a Linux technology. On macOS, Docker Desktop runs a Linux virtual machine inside Apple's Virtualization Framework. When you mount your Laravel project directory into the container (via volumes: - '.:/var/www/html'):
- Every single PHP file read must cross the host-to-guest virtualization boundary via VirtioFS or gRPC-FUSE.
- A standard Laravel request inspects 500+ PHP files across the
vendor/directory, framework service providers, configuration files, and Blade templates. - Each file lookup involves network socket IPC and kernel translation between macOS APFS and the Linux guest filesystem.
- Result: 10x to 50x slower I/O latency, audible MacBook fans, and massive battery drain.
Docker Sail vs. Stratos Native Swift Benchmark
| Metric | Stratos (100% Native Swift) | Docker Desktop (Sail / VirtioFS) |
|---|---|---|
| Average Page Latency | 1.8 ms (Native APFS) | 185.0 ms (Virtual VM Bridge) |
| Idle CPU Usage | < 0.1% CPU | 18% – 35% CPU (qemu/virtiofs) |
| RAM Footprint | 62 MB | 4,800 MB (Linux VM allocation) |
| MacBook Battery Life | 10.5+ hours | ~3.2 hours (battery drain) |
How to Migrate from Laravel Sail to Stratos in 60 Seconds
You don't have to rewrite your application or delete your Docker files:
- Stop your Sail containers:
./vendor/bin/sail down - Open Stratos and drag your project folder into the app.
- Stratos provisions local Nginx, links your
.testdomain, and generates a trusted green SSL certificate automatically. - In your
.envfile, setDB_HOST=127.0.0.1andREDIS_HOST=127.0.0.1. - Visit
https://my-app.testin Safari or Chrome and experience instantaneous sub-2ms response times.