Laravel Octane + Native Docker + WSL2: Extreme Performance Issues

1 day ago 3
ARTICLE AD BOX

I'm experiencing severe performance issues with my Laravel application running on Docker + WSL2. Despite implementing numerous optimizations, all pages take 2-10 seconds to load. I'm hoping someone has experienced this and can point me in the right direction.

## Environment - **OS:** Windows 11 with WSL2 (Ubuntu) - **Framework:** Laravel 11 + Filament 3 + Livewire 3 - **Server:** Laravel Octane with Swoole (4 workers) - **Setup:** Docker Compose (multi-container) - **Database:** Microsoft SQL Server (Docker container) - **Cache/Session:** Redis (local Docker container) - **Project Location:** WSL2 native filesystem `/data/www/` (NOT `/mnt/c/`) ## The Problem **Every single page** takes 2-10 seconds to load in the browser, despite server logs showing only 300-400ms PHP processing time. **Performance Metrics:** Server logs (`storage/logs/performance-*.log`): ```json { "total_ms": 300-400, "database_ms": 0, "app_logic_ms": 300-400 }

Browser DevTools (actual user experience):

Simple pages: 2-4 seconds

Dashboard: 6-10 seconds

All pages consistently slow

There's a 1.5-9.5 second gap between what the server reports (300ms) and what user experience (2-10s).

What I've Already Tried

I've implemented every optimization I could find:

OPcache CLI enabled - opcache.enable_cli=1 verified with php -i
Vendor in Docker volumes - Moved vendor/ and node_modules/ to named Docker volumes (not bind mounts)
Swoole workers optimized - Using 4 workers
Laravel caching
Debug tools disabled - APP_DEBUG=false
, Debugbar and Clockwork off
Local Redis - REDIS_HOST=redis (Docker container, not remote)
Local storage - Switched from Azure Blob Storage to local disk
Broadcasting disabled - BROADCAST_CONNECTION=log

=========================================

What I've Observed

Server logs consistently show 300-400ms processing time

Browser shows 2-10 seconds total load time

The 1.5-9.5 second gap is unaccounted for

All pages are affected, not just specific features

Subsequent refreshes don't get faster (caching doesn't help)

So the question is

Is this normal overhead for Docker + WSL2? Should I expect 2-10 seconds page loads with this stack?

Read Entire Article