The Daily
A note a day on APIs and the realities of shipping web applications. Stuff I've actually learned across 25 years of doing the work.
Your Singleton Isn't a Singleton in Laravel Octane
Laravel Octane's persistent process model breaks a core assumption you've been making since day one. Here's what actually happens to your singletons.
I spent an afternoon last year chasing a bug where a healthcare client's per-request tenant context was leaking between requests under load. The app had been running fine on traditional FPM for two years. We moved it to Octane for the performance gains and within a week we had users occasionally seeing another…
Read the daily →PHP-FPM: What Actually Kills Your Long-Running Request
request_terminate_timeout and max_execution_time both kill PHP processes, but they're not the same thing - and using the wrong one will bite you in production.
I've debugged enough dead workers and zombie processes over the years to have a strong opinion on this: most developers who configure PHP-FPM don't actually know which of these two settings is doing the killing, and that ignorance eventually takes down a production queue worker or a long-running report at the worst…
Read the daily →Stripe Webhooks Will Race You. Here's How to Win.
Idempotency keys feel like a safety net until you hit 500 orders a day and realize your webhook handler has a race condition that's been double-charging people.
Stripe will deliver the same webhook event more than once. They document this openly. Most developers read it, nod, and then write a handler that's still broken under load. I was one of them until an e-commerce client's fulfillment system started creating duplicate shipments on Black Friday. The idempotency key Stripe…
Read the daily →Swap on a Laravel VM: Survival Mechanism, Not a Fix
Swap on a production VM isn't shameful - it's a tuning decision. Here's how I configure it and why I treat it as a canary, not a crutch.
Every Laravel project I've deployed on a small VPS has eventually hit the same wall: the OOM killer shows up unannounced, takes out php-fpm or MySQL, and the site goes dark. Swap didn't cause that. But the absence of swap made it uglier than it had to be. Here's how I think about it after two-plus decades of keeping…
Read the daily →Laravel Log Rotation on a Single VM: The Octane File-Handle Trap
Running Octane and logrotate on the same VM looks fine until your logs silently vanish. Here's what's actually happening and how to fix it.
Logrotate runs at 2 AM, rotates to , creates a fresh , and your monitoring says everything is fine. But Octane is still writing to the old inode - the one that's now - and the new file stays empty until you restart the worker. This is a silent failure. No exceptions, no alerts, just a log file that stops growing while…
Read the daily →