FrankenPHP Worker Mode Cuts Tenant-Switch Cost in Shared Symfony 8.1 Deployments
A follow-up to an earlier article examines running a database-per-tenant SaaS on a shared Symfony 8.1 deployment with FrankenPHP's worker mode. The author notes that under php-fpm each request re-boots the kernel, re-queries Redis for tenant placement, and opens a fresh database connection, costing about 5.8 ms per tenant switch. FrankenPHP keeps the kernel alive across requests, which can eliminate much of that per-request overhead. The article also warns that worker mode changes which state persists between requests, so care is needed to avoid leaking data between tenants. The author plans to compare four deployments under a load that switches tenants on every request. The demo uses PHP 8.4, PostgreSQL 16, Redis 7 and FrankenPHP 1.13, and the Symfony runtime package is used because the separate FrankenPHP adapter does not yet support Symfony 8.1.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in