{"componentChunkName":"component---src-templates-post-js","path":"/frankenphp-vs-php-fpm/","result":{"data":{"markdownRemark":{"html":"<p><strong>TL;DR:</strong> FrankenPHP is a good server, but the speed people credit it with comes from worker mode, not from FrankenPHP itself. We benchmarked two real Symfony apps on four setups. Worker mode made HTML pages 2-3x faster and light API calls 6-11x faster, but a real user opening a project in the browser saw only a 6-10% improvement. Worker mode also changes your application more than your infrastructure: on an older Symfony app it leaked data between requests until we found and fixed a shared service. Some of the best findings were plain configuration bugs in the setups we were comparing against.</p>\n<p>Every few months someone on our team asks whether we should \"just move to FrankenPHP\". I get the appeal. You replace nginx (or Apache) and php-fpm with a single binary, you get HTTP/3 and Early Hints thrown in, and the benchmark charts show PHP serving ten times more requests per second.</p>\n<p>The trouble is that I can't show a client a chart from a README and call it a plan. I wanted numbers from applications that look like the ones we actually maintain. So I took two Symfony apps, ran each of them on every common PHP setup, and measured.</p>\n<p>The first is <a href=\"https://dynamiczne.info\" target=\"_blank\" rel=\"nofollow\" rel=\"noopener\">dynamiczne.info</a>, a side project of mine that already runs on FrankenPHP. The second is, a project-management SaaS we build for a client here at Accesto, I will call it \"Accesto Client\" from now on. It runs on Apache and php-fpm, and has for years.</p>\n<p>Spoiler: FrankenPHP itself turned out to matter much less than I expected. What I found along the way mattered more, and most of it was configuration.</p>\n<h2>What we compared</h2>\n<p>The same Symfony application, four ways, each in one container with <strong>2 CPUs</strong>:</p>\n<ul>\n<li><strong>FrankenPHP in worker mode.</strong> The app boots once and stays in memory, and every request reuses the same kernel.</li>\n<li><strong>FrankenPHP in classic mode.</strong> Caddy with PHP built in, but Symfony boots from scratch on every request, just as it does under php-fpm.</li>\n<li><strong>php-fpm behind nginx.</strong></li>\n<li><strong>php-fpm behind Apache</strong> (<code class=\"language-text\">mpm_event</code> + <code class=\"language-text\">proxy_fcgi</code>).</li>\n</ul>\n<p>Keep the first two apart in your head, because the rest of this article depends on it. FrankenPHP is a web server. Worker mode is a different way of running PHP. When you see an impressive FrankenPHP number, it's almost always about worker mode.</p>\n<h3>How I measured</h3>\n<ul>\n<li>Load came from <a href=\"https://k6.io\" target=\"_blank\" rel=\"nofollow\" rel=\"noopener\">k6</a> on a separate machine, with <code class=\"language-text\">Accept-Encoding: gzip</code> and OPcache warmed up.</li>\n<li>For throughput, 64 virtual users hammered each endpoint for 30 seconds. I repeated that three times, rotating the order of the variants, and I report the median.</li>\n<li>For latency, every variant got the same fixed request rate: 60% of what the slowest one could handle.</li>\n<li>Every variant got the same <code class=\"language-text\">php.ini</code>, OPcache settings and preload script. That sounds like a given. It was the hardest part of the whole exercise, and I'll come back to it.</li>\n<li>I ran everything on two machines, an Apple M3 Max (arm64) and an AMD Ryzen 5825U mini PC (amd64). I only compare variants with each other on the same machine, never one machine with the other.</li>\n</ul>\n<h2>App 1: dynamiczne.info</h2>\n<p>dynamiczne.info shows hourly electricity prices in Poland. It has a dashboard, pages for each day and month, a comparison tool and a small public JSON API. It's Symfony 8.1 on PHP 8.5 with PostgreSQL and no ORM. Pages are rendered with Twig and Live Components, so a typical request runs a few queries and then spends a while in templates.</p>\n<h3>Throughput (arm64, requests per second, median of three)</h3>\n<table>\n<thead>\n<tr>\n<th>Endpoint</th>\n<th align=\"right\">FrankenPHP worker</th>\n<th align=\"right\">FrankenPHP classic</th>\n<th align=\"right\">php-fpm + nginx</th>\n<th align=\"right\">php-fpm + Apache</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Dashboard <code class=\"language-text\">/</code></td>\n<td align=\"right\">240</td>\n<td align=\"right\">78</td>\n<td align=\"right\">70</td>\n<td align=\"right\">71</td>\n</tr>\n<tr>\n<td>Day page</td>\n<td align=\"right\">364</td>\n<td align=\"right\">129</td>\n<td align=\"right\">121</td>\n<td align=\"right\">122</td>\n</tr>\n<tr>\n<td>Comparison page</td>\n<td align=\"right\">340</td>\n<td align=\"right\">146</td>\n<td align=\"right\">158</td>\n<td align=\"right\">152</td>\n</tr>\n<tr>\n<td>Month page (Postgres-bound)</td>\n<td align=\"right\">3</td>\n<td align=\"right\">2</td>\n<td align=\"right\">2</td>\n<td align=\"right\">2</td>\n</tr>\n<tr>\n<td>API: prices</td>\n<td align=\"right\">1,602</td>\n<td align=\"right\">191</td>\n<td align=\"right\">173</td>\n<td align=\"right\">172</td>\n</tr>\n<tr>\n<td>API: outlook</td>\n<td align=\"right\">1,387</td>\n<td align=\"right\">192</td>\n<td align=\"right\">149</td>\n<td align=\"right\">183</td>\n</tr>\n<tr>\n<td>API: raw fixing</td>\n<td align=\"right\">1,710</td>\n<td align=\"right\">177</td>\n<td align=\"right\">329</td>\n<td align=\"right\">299</td>\n</tr>\n<tr>\n<td>Static CSS file</td>\n<td align=\"right\">16,368</td>\n<td align=\"right\">15,487</td>\n<td align=\"right\">58,961</td>\n<td align=\"right\">33,297</td>\n</tr>\n</tbody>\n</table>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1300px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/blog/static/4ee4d952063bfc83c9f1ba9b15d0eee0/07a9c/dynamiczne_pages.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 72.92307692307692%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAABibAAAYmwFJdYOUAAACoklEQVQ4y31UWU8aURjl5zYmfWmT9qntUx+aNjGtW9A07ZvFJl0SoaaiUlu1iIoUFREUZmQoFGH27c4Mp9+dAcTECDlz5nLnHr7lfBPzPAYOP/DRkgScl4sQa2cQL8qQxHPUqiVaVyAM1pf1CkShDlEUUK1WoGkaAjobavgeYvzi+z7QD1BrachfyCjUFeIu9sp/cXjewX65hVxJIjRRoHVXVmHbJkzTAGMuhkFxxPjFskzacLCe3sH8XALv4wkkPm1j+Y+OZF5G8lBBqqAOWEGrq1EAPqJgPBJybwpqmgLLtLF18BaLyXtIpCbQErOIPozgEfwRcxGXMbiuO+KRIN/kNQj6fUAvAb1Nwk86ezUmclPwmsdAEbNhhFyU/1DvAvlLoNAgiB7V0sZezUS2omK3qoWcvYV/E3dkA4HvRhHatgXHsfE9tYLpySnMz8QRn1lA/M0sPi6tYLUoI3OiYONYxsYtvE7M63pD0LIc7Bbf4cvaBJYzDwkP8HX9PoRaZlDLu1KPmLGxlP2AauhKgHMK2GXiM2K6D2R6OLhTKKDzbNiUsCFBVNhyg2Hz2MV2ycFWyQ2xc2Lg17FKaalIU+prRzLSR9fM0eyoZGMWRcjNyW3D0/6W+ozXk88xN/MKs9MvQ0xPvcBCchU7FQUHFxr2CXsDHt53ZJ2iZFGXuZBp6nBshuLZItayj/Ej9xSZ3BPiZ9jIPkLu9EPogijN4BbLeNc+5CPX5+Bfk3xjthCo5BurDa8nkDclOEobhmmh1+vBMAwoihIams+xQ6bWDT2cNIM4phlRhHxh0aZM9tGp45bj0Zr+mQJy+GFVgUrQNDUcVd7I4RyPc6xZFyDQm0OgN8jV1T8020U0GiIk6ZLWHWoYOYAeHjaPI5pfNprlcfwHOzlbmixVrG8AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Bar chart of dynamiczne.info HTML page throughput for each setup relative to php-fpm with nginx\"\n        title=\"FrankenPHP vs php-fpm throughput on dynamiczne.info pages\"\n        src=\"/blog/static/4ee4d952063bfc83c9f1ba9b15d0eee0/3c492/dynamiczne_pages.png\"\n        srcset=\"/blog/static/4ee4d952063bfc83c9f1ba9b15d0eee0/ff46a/dynamiczne_pages.png 325w,\n/blog/static/4ee4d952063bfc83c9f1ba9b15d0eee0/a6d36/dynamiczne_pages.png 650w,\n/blog/static/4ee4d952063bfc83c9f1ba9b15d0eee0/3c492/dynamiczne_pages.png 1300w,\n/blog/static/4ee4d952063bfc83c9f1ba9b15d0eee0/07a9c/dynamiczne_pages.png 1440w\"\n        sizes=\"(max-width: 1300px) 100vw, 1300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1300px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/blog/static/e463a03cb36dec1c3fb6d5b9acdc6911/07a9c/dynamiczne_api.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 72.92307692307692%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAABibAAAYmwFJdYOUAAACZ0lEQVQ4y3VTy07bQBT1z3bTP6i67h5RVe2mW9QVSEBZER4SEuURCDQkJCbBCU5IIH6NXzMeO6d3xqRK0sbS0fFczxz5nHvHkDJDURQImY9Oq45+t4Un64FgajzbFrpmA/3HNsbDnq7FzEH5SEKO6TRHnkvkpGVISUUqBDHHVcdFreug2nrGJeGqPcK1+YLz5gAX90NUaV23PDRthvYwRmsYEWJ4LIaUApJEDSG4XvQsG9+//sDG1il2agH2bnzsXnv4WfM19m4Czaq2c+Viu+oQO9im96exB5mlpSAXKdJEoD+4xcbuO5jmwZyd0tK/vIwCKjoFI88pwym5Fi7gHgNiRBumK4TmBSVlL8Gz7E2MLFN8hgoTUwmWFKjZwKXFcfYQEBjOzBVM33+ZDCMnJKtcN6QUpD9M0wQZFbudDr6tfcbm5hEqjQBHDR+Hdx4O/8eEgzsfg9dAZ7coyBPwNIM9qmO78h4T63gpw2JlhtMi15YFIctEOTZ6flSIMgTSJvHLQk6LgvnKpqjYdJfzvCx6ocRJQ+C0meCkGaJClvZ/e6jUZ+xhv17y/Ltm2jtyAvpDASOKGNQsmuY9vqx9wvrOHjZue7hou6h22QIul9Z/8RjC8cNSMEkiCC4xem3g6PwjDi4+0I3Y0rdn0WqxxPlSnm+W1UE1dUWWANEzENiQkavDZiFDRkH7QYAojuG6LhhjiKIIIYFzTt98aoqgeqCdGixKEMeh3pBklCVPESUJ0jSGGqmCOqk4oIPq0Ozg7Gao7s6zMbR66PUJPQuTyRjDlzps+wmDgQ3HmWhBNQmKZ9CTsQJ/AJukaiE4Et45AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Bar chart of dynamiczne.info API throughput for each setup relative to php-fpm with nginx\"\n        title=\"FrankenPHP vs php-fpm throughput on dynamiczne.info API\"\n        src=\"/blog/static/e463a03cb36dec1c3fb6d5b9acdc6911/3c492/dynamiczne_api.png\"\n        srcset=\"/blog/static/e463a03cb36dec1c3fb6d5b9acdc6911/ff46a/dynamiczne_api.png 325w,\n/blog/static/e463a03cb36dec1c3fb6d5b9acdc6911/a6d36/dynamiczne_api.png 650w,\n/blog/static/e463a03cb36dec1c3fb6d5b9acdc6911/3c492/dynamiczne_api.png 1300w,\n/blog/static/e463a03cb36dec1c3fb6d5b9acdc6911/07a9c/dynamiczne_api.png 1440w\"\n        sizes=\"(max-width: 1300px) 100vw, 1300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>The amd64 machine told the same story: worker mode was 2.7-3.3x faster on HTML and 5-8x on the API, and classic mode stayed within 10% of php-fpm.</p>\n<p>Worker mode is where all the speed comes from. HTML pages got 2.2-3.4x faster and JSON endpoints 5-9x. The API gains more because each call does very little, so booting Symfony is a large part of the cost. A page that spends most of its time in Twig and the database has less to gain.</p>\n<p>Without the worker, FrankenPHP behaves like php-fpm. Classic mode landed within ±10% of both php-fpm setups on almost every endpoint, and on the raw fixing API it was actually <em>slower</em>: 0.55x of php-fpm on arm64, in all three runs. So if you move to FrankenPHP and leave the worker off, you've changed your web server and that's about it.</p>\n<p>nginx is still much better at static files: 59k requests per second against 16k for Caddy. If a CDN sits in front of your app, you'll hardly notice. If your app serves its own assets to a lot of people, you might.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1300px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/blog/static/758426d1a9335a62227f56e742e23c03/07a9c/static_files.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 54.46153846153846%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAABibAAAYmwFJdYOUAAACLUlEQVQoz22Ty27TQBSG81qIB+AVEIhbSVNx2XbNDlF1xaaIRQtItLAAqYC6AHZRaUPauKpaGiDk5iSQi+Pr2GOP7fycGScFKiJ9OcdW/Hu+M5NcHAtIkiRGr9tCp/0DequGYV+HrjdRb9bR1luq1ht1NNtNMJ8hpt+LOCKEYpaRk1+SNE1wUuujfNjF/lEP5aOfFP4LzBjCHY3gGSMElo0k4EAywdlPShlxIpCLRIQwDJHS2xa3Wji3cowLq1WcX/mCR/sNHDMDmmdDcy1o9gCa2cbeqDmlgfKwgQOjDcb9bIWMebBsE77HsFRcxqVXV5F/s4D5twUU3mU1L9mcw/yHe1govcStz+vEBvEChdI6Fiuv0TMGmMyU05S0U9KoLQOVy4CWR7hzA8H2NfDt6+Cf5sCLFxFUV0FCpByTY0o1ySqRTkd3OsPJJMFmxcXSlom1ogmHhWpUgp6JJxmJyqDNoNT4r81QPd1TgWHI4XkuAt/Ds8oY9z9a2Nhl8OXLaTExplXwP0GyJuL0+p9A2QSBTxsTwTp5gLB8BTi4C1a6DW/3DtjOTTjfniMUEzIT6jTMrP5HTs5P6iY0B66/h//9KYaHj+FW1+B+fYKh9hC8X8JgNAbzHGVjmmP1sG2Z4DxQWNTLleY4jyG1fTqsgaAZkZ5PgxfIelkFOZumAdd14Di2MpKBURRmymQ563N7nS70jg7bthTC68Ix+wjluYrDKRFZpEp3xuyfcZbfAucqx7uM0HIAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Bar chart of static file requests per second for Caddy, nginx and Apache\"\n        title=\"Static file serving: Caddy vs nginx vs Apache\"\n        src=\"/blog/static/758426d1a9335a62227f56e742e23c03/3c492/static_files.png\"\n        srcset=\"/blog/static/758426d1a9335a62227f56e742e23c03/ff46a/static_files.png 325w,\n/blog/static/758426d1a9335a62227f56e742e23c03/a6d36/static_files.png 650w,\n/blog/static/758426d1a9335a62227f56e742e23c03/3c492/static_files.png 1300w,\n/blog/static/758426d1a9335a62227f56e742e23c03/07a9c/static_files.png 1440w\"\n        sizes=\"(max-width: 1300px) 100vw, 1300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<h3>Latency at the same load</h3>\n<p>At the same request rate, the median request in worker mode was 2-4x faster on both pages and API calls. For example, 3.8 ms instead of 9 ms on the prices API, and 8 ms instead of 17-20 ms on the day page. The slowest 1% of requests (p99) was usually better too, but not always. On the arm64 dashboard the worker's p99 was 50 ms, against 28-37 ms for php-fpm. A faster median doesn't automatically mean a shorter tail.</p>\n<h3>What made no difference</h3>\n<ul>\n<li><strong>CPU architecture.</strong> I half expected FrankenPHP to shine on arm64. It didn't: the ratios were the same on both machines, give or take the noise on the amd64 box.</li>\n<li><strong>Production <code class=\"language-text\">php.ini</code> and web server tuning.</strong> Before the third run I added <code class=\"language-text\">php.ini-production</code> to every variant, <code class=\"language-text\">open_file_cache</code> to nginx and <code class=\"language-text\">EnableSendfile</code> to Apache. The medians moved by less than 10%, some up and some down.</li>\n<li><strong>The month page.</strong> It waits on a PostgreSQL query and manages 2-3 requests per second whatever runs the PHP. No web server will fix a slow query.</li>\n</ul>\n<h3>Bugs I found in my own production setup</h3>\n<p>Honestly, the best thing to come out of this wasn't a number. Benchmarking forced me to look closely at a configuration that had been in production for months, and I found three bugs in it:</p>\n<ol>\n<li><strong>Caddy was compressing every asset on the fly.</strong> FrankenPHP puts its <code class=\"language-text\">php_server</code> directive ahead of <code class=\"language-text\">file_server</code> in Caddy's directive order, so my <code class=\"language-text\">file_server … precompressed</code> block for <code class=\"language-text\">/assets</code> never ran. One line in the global options fixed it (<code class=\"language-text\">order file_server before php_server</code>), and static files went from 2,750 to 15,800 requests per second.</li>\n<li><strong>Caddy was overwriting every <code class=\"language-text\">Cache-Control</code> header PHP set.</strong> A <code class=\"language-text\">header</code> block I'd meant as a default for static files replaced the header on every response. That included the <code class=\"language-text\">no-store</code> on the admin page that shows a new API key exactly once. The fix was a <code class=\"language-text\">?</code> prefix (<code class=\"language-text\">?Cache-Control</code>), which only sets the header if it's missing.</li>\n<li><strong>The production image had no <code class=\"language-text\">php.ini</code> at all.</strong> PHP was running on its built-in defaults: <code class=\"language-text\">display_errors=1</code>, <code class=\"language-text\">zend.assertions=1</code>, <code class=\"language-text\">expose_php=1</code>. That didn't slow anything down, but it's not what you want on a public server.</li>\n</ol>\n<p>None of this is FrankenPHP's fault. But when one config file replaces two that you've known for a decade, these things slip through, and Caddy's directive order takes some getting used to.</p>\n<h2>App 2: Accesto Client</h2>\n<p>dynamiczne.info is small, and I wrote it with worker mode in mind. Accesto Client is the opposite. It's a large Symfony 7.4 application with Doctrine ORM, FOSUserBundle, HWIOAuthBundle, RabbitMQ consumers and websocket servers. Its Apache configuration has grown over the years. It now covers Cloudflare and ALB proxy ranges. On top of that come S3 proxies for the landing page, External Service addons, and <code class=\"language-text\">X-Frame-Options</code> rules that depend on the Referer.</p>\n<p>In other words, a pretty typical PHP application, which makes it the more useful test.</p>\n<h3>Porting the Apache rules to Caddy</h3>\n<p>I treated the Apache files as the source of truth and generated the Caddyfile from them. That way long values like the CSP and the proxy ranges were copied, not retyped. Then I ran both images side by side and compared status codes and headers for 24 kinds of request.</p>\n<p>Before that comparison I'd have told you the port was finished. It wasn't:</p>\n<ul>\n<li><strong>Another directive-order trap.</strong> In Caddy, <code class=\"language-text\">respond</code> runs after <code class=\"language-text\">handle</code>. With a catch-all <code class=\"language-text\">handle { php_server }</code>, my <code class=\"language-text\">respond /healthz 200</code> and the <code class=\"language-text\">.git</code> block never got a chance to run. Each of them needed its own <code class=\"language-text\">handle</code>.</li>\n<li><strong>Caddy happily served <code class=\"language-text\">.htaccess</code>.</strong> Apache blocks <code class=\"language-text\">.ht*</code> files in its default config. Nobody writes that rule themselves, so nobody thinks to port it.</li>\n<li><strong>OPcache preloading was quietly switched off.</strong> The php-fpm pool sets <code class=\"language-text\">php_admin_value[opcache.preload]</code>. Preloading happens in the FPM master before any pool starts, though, so the setting is ignored and production preloaded <strong>0 scripts</strong>. FrankenPHP reads the same value from <code class=\"language-text\">php.ini</code> and preloaded 9,179. Had I compared the two as configured, FrankenPHP would have taken credit for something php-fpm gets from one line in <code class=\"language-text\">php.ini</code>. So I measured php-fpm both ways.</li>\n</ul>\n<p>After the fixes, the remaining differences were either intended or harmless. JSON is now gzip-compressed (Debian's <code class=\"language-text\">mod_deflate</code> doesn't compress <code class=\"language-text\">application/json</code>). Go normalises header names, so <code class=\"language-text\">X-MinuteRateLimit-Limit</code> becomes <code class=\"language-text\">X-Minuteratelimit-Limit</code>. And <code class=\"language-text\">/.git</code> paths now get a 403 instead of a 404.</p>\n<h3>Throughput (arm64, requests per second, median of three)</h3>\n<p>Same method as before: 2 CPUs and 2 GB per container, with MariaDB, Redis and RabbitMQ in their own containers. \"Apache + preload\" is the production image plus one <code class=\"language-text\">php.ini</code> line that makes preloading actually work.</p>\n<table>\n<thead>\n<tr>\n<th>Endpoint</th>\n<th align=\"right\">FrankenPHP worker</th>\n<th align=\"right\">FrankenPHP classic</th>\n<th align=\"right\">Apache + php-fpm (as in production)</th>\n<th align=\"right\">Apache + php-fpm + preload</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">/healthz</code> (no PHP)</td>\n<td align=\"right\">16,059</td>\n<td align=\"right\">15,443</td>\n<td align=\"right\">43,404</td>\n<td align=\"right\">43,940</td>\n</tr>\n<tr>\n<td>Static CSS file</td>\n<td align=\"right\">10,660</td>\n<td align=\"right\">10,559</td>\n<td align=\"right\">25,228</td>\n<td align=\"right\">24,626</td>\n</tr>\n<tr>\n<td>Login page</td>\n<td align=\"right\">2,262</td>\n<td align=\"right\">232</td>\n<td align=\"right\">145</td>\n<td align=\"right\">198</td>\n</tr>\n<tr>\n<td>API: list projects</td>\n<td align=\"right\">1,180</td>\n<td align=\"right\">170</td>\n<td align=\"right\">141</td>\n<td align=\"right\">147</td>\n</tr>\n<tr>\n<td>API: one project</td>\n<td align=\"right\">1,132</td>\n<td align=\"right\">155</td>\n<td align=\"right\">112</td>\n<td align=\"right\">138</td>\n</tr>\n<tr>\n<td>API: tasks of a project</td>\n<td align=\"right\">827</td>\n<td align=\"right\">154</td>\n<td align=\"right\">117</td>\n<td align=\"right\">136</td>\n</tr>\n</tbody>\n</table>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1300px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/blog/static/ee5000933715a659723d6d340076962d/07a9c/speedup.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 91.07692307692308%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAACXBIWXMAABibAAAYmwFJdYOUAAACw0lEQVQ4y4VUXU8TQRTtj/PdZ195MAFf/AG+mGgAEzFCiKIYaDAhmvgJRI3RiEajwaCJIcVKP5a22+62+9nu7O7sbo93prvQAtUmp+fO7czpPXc+clHEEccROA9RP1RQLv1BtVLCoVKR8X5hT45LB0WZq5QPUCzuy5xSLaP4uyDzQkMglwkKaIaFhm6gSVC1DhqtNmqqhlbblLHI1Zs6ak2NxjqN21DqTei0TqwXWlJQgBNuPFUwsVjAVP4Qk/ka8QCTqzU5Hs5luLhSw9VnKmzHIVESjEmo1+vCoUR1fgrFB9NoWAF024dmM2gWG8TEmsz5NGYw3AAd10fb8WH1AtmykQojSmD3MmB+w+CTEPpncBr3Y0JEIZec6eSE9ySJJZ7vhVj81MXSew13353GPcrfftPC54JBQiFCTq3iQmhI0PN66HZduIQn82uYn3mI5W0Nqx91rGynSOM88RIJ7xxYVOWg79mmHgmGYQA/8Alk+fE54MOV1HL8D8vxSFUjgseWE7TUr1BaJahWBNX0CD5Ug41ww/DRcRgtDs8WFBUKBITZ9Qombv3C1GqVoEhMDvGlPB2r5SoWXjfAQxIVF+KkoOih6zqyh62FC2g8moVN7j0WoOeH6BF7KYu2+OFgM4ZFxlimnu1fBzpfhnqYjPSyT0clEbcq4uN7mCWE4NpOgGtbBmY3VcxsHGP6pYqbWyospysF+f8qFLYdsv12bg7rc/fx4oeFzV3jCBu7Jl79NMH8QF4vcSvGC9JXSBNC6g3fOI/w+53UcpRaPkaSREcPSYZTggn9o7ArkswtUxU27XhEoA0IAjDG5CZ4zEN2InyKRZW+zxDQGRZCGecYT+SPcjLvI+aMJnqyDaZpwDA6xB04tiVPg01sp7FlmQhJSBQj1kvBRkWhR7OMcqUMXWuCd+s00aDnyJYLHWKx8KTVcfgL6xQ7xiiWEnUAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Bar chart of throughput for each setup relative to php-fpm with preload\"\n        title=\"FrankenPHP vs php-fpm throughput\"\n        src=\"/blog/static/ee5000933715a659723d6d340076962d/3c492/speedup.png\"\n        srcset=\"/blog/static/ee5000933715a659723d6d340076962d/ff46a/speedup.png 325w,\n/blog/static/ee5000933715a659723d6d340076962d/a6d36/speedup.png 650w,\n/blog/static/ee5000933715a659723d6d340076962d/3c492/speedup.png 1300w,\n/blog/static/ee5000933715a659723d6d340076962d/07a9c/speedup.png 1440w\"\n        sizes=\"(max-width: 1300px) 100vw, 1300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1300px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/blog/static/9208b844d74f6bd5da5f51cae4dc8cbd/07a9c/steps.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 40%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAABibAAAYmwFJdYOUAAABgUlEQVQoz22SO2/UQBSF91/T0REEikSNQIACNBQQKSkCDUtIkTQ8GqTVKt5XIN54vfaM32N7P+61YktBFEfnznjmzD3netQ0NYq2bTqwa/E3lqm3wruc4nmXzGZeh8Vi3q3n8xmr1bLbWy4XOFd1GnXtGFVViSJNE0wckWQl28kh4fQTmyjh5sYnDDfd96LIybKUPM8G6J4KDYJ60FrTXfL9PwSh5frHE9aTN0SJk0e2lGXBTjrvnfzLKtRjpJt6WF/z1z5FHPNocsG9X2Os1MZakjSlco6yqgR32Tl3V7AvtMutdGmygvzLW5r3D6CMoTKSaw60guY/rB1KpzqLvkMV1GySxOLqktPP33j67CMvx9e8GPu8Ol1z8DXg4Gwz8OuzgOfjgPOpoXG5OMy7PAdBFTPGUGSGo58xeycRj49W7B//5uHhXOor9j7MBt4/vuL+O4+T72tsFMgMws7hqJ9Q/9toDe7WjnCbivVIOBH7t6zrWqIot+yc5CtZqo4O7y/0BFfXuW0+zgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Chart breaking down where the Accesto Client speed-up comes from\"\n        title=\"Where the Accesto Client speed-up comes from\"\n        src=\"/blog/static/9208b844d74f6bd5da5f51cae4dc8cbd/3c492/steps.png\"\n        srcset=\"/blog/static/9208b844d74f6bd5da5f51cae4dc8cbd/ff46a/steps.png 325w,\n/blog/static/9208b844d74f6bd5da5f51cae4dc8cbd/a6d36/steps.png 650w,\n/blog/static/9208b844d74f6bd5da5f51cae4dc8cbd/3c492/steps.png 1300w,\n/blog/static/9208b844d74f6bd5da5f51cae4dc8cbd/07a9c/steps.png 1440w\"\n        sizes=\"(max-width: 1300px) 100vw, 1300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>Here's how it looks against the fairest baseline, php-fpm with preloading fixed:</p>\n<ul>\n<li><strong>Worker mode is 6-11x faster on PHP endpoints.</strong> That's more than on dynamiczne.info, because Accesto Client's kernel is far bigger (9,179 preloaded files) and the test data is tiny, so booting the framework is nearly all the work. The login page is the extreme case at 11x, since it's a form and not much else.</li>\n<li><strong>Classic mode is 1.13-1.17x faster.</strong> Unlike on dynamiczne.info, FrankenPHP without the worker did beat php-fpm here. I didn't dig into why. My first suspects would be the extra FastCGI hop, and an FPM pool sized for 50 children on 2 CPUs. Against Accesto Client <em>as it runs in production</em> (no preload), classic mode looks 1.2-1.6x faster, but a third to a half of that comes from the preload bug, not from the server.</li>\n<li><strong>Fixing preload on its own gives up to 1.36x</strong> on the login page and 1.04-1.24x on the API. That's one line in <code class=\"language-text\">php.ini</code>, without touching the server.</li>\n<li><strong>Apache serves files 2.4-2.8x faster than Caddy</strong>, much like nginx did on dynamiczne.info.</li>\n</ul>\n<p>At the same fixed rate, worker mode roughly halves the median response time compared with php-fpm with preload: 7 ms instead of 10.5 ms for a single project, 3.9 ms instead of 6.1 ms for the login page. The slowest requests were noisy in this run. Some went over 100 ms in FrankenPHP classic and in php-fpm, never in the worker, but with one repetition I wouldn't call that a pattern.</p>\n<p>Memory goes the other way. Under that load the container used about <strong>550 MB in worker mode, 970 MB in classic mode and 315-420 MB with php-fpm</strong>. Classic FrankenPHP was the hungriest of the four, which is worth knowing before you pick instance sizes.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1300px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/blog/static/46caed3f73f9ea1496e8028592124f91/07a9c/memory.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 42.15384615384615%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAABibAAAYmwFJdYOUAAABqklEQVQoz3WSTU/UUBSG+6uMK/0TupHEmIjGIfoTdG1QivAD2LnRncYFBhzjShCJI8ksZJx2ph1GKM70++P2to+nBcUNi6d9z8k5773ntEZZKpRArXE9n829IR8PXLrfHbo9h619iw/fRvIesX84xTk6Yup5RFlOBehzGh8tGFqXlLpJwU7fY3F5hyXzC52VXR4IS+YeHYlvP/2M+fIrgdVHey7liUP+y6ZoaGJV0HgZWZYSRwGZrpj1PmEt38Ey72Ot3GsZPr+LYy7irz9sma/9x/oj5i86+BtPOD2eopQ6MwyjEApFd9Tj5vtnLGyvcmtrlQXhxvYaj3dfczqdoJIQlUaUaSxE51rI4rORmxs2D60Lahk5cDY5fHOFwbvrwjV+vr3Kj/4rxkGErqSuqmQ9sqJKt2u60KXcrmhNjVo+Ri3JxrBMZ+I6gMgiP+lTN7qMyNNUGnKSJCYI/LZRFTlheKH/5o1ZkOBL4PtzYmn8nacEcUaUFoSJFIZRa1TJoWma/BvtMgzPtrCtIbZtcyyL9bwD0QNcZ8x4bAsjJhO3LW5M279CTC/jD1plQ8ApSjjmAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Bar chart of container memory usage under the same load\"\n        title=\"Memory usage: worker vs classic vs php-fpm\"\n        src=\"/blog/static/46caed3f73f9ea1496e8028592124f91/3c492/memory.png\"\n        srcset=\"/blog/static/46caed3f73f9ea1496e8028592124f91/ff46a/memory.png 325w,\n/blog/static/46caed3f73f9ea1496e8028592124f91/a6d36/memory.png 650w,\n/blog/static/46caed3f73f9ea1496e8028592124f91/3c492/memory.png 1300w,\n/blog/static/46caed3f73f9ea1496e8028592124f91/07a9c/memory.png 1440w\"\n        sizes=\"(max-width: 1300px) 100vw, 1300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<h3>Does worker mode survive a typical app?</h3>\n<p>All of the above assumes the app behaves the same when it isn't torn down after every request. For dynamiczne.info that was a rule from day one. Nobody working on Accesto Client has ever had to think about it.</p>\n<p>Symfony does a lot of the work for you. Services tagged <code class=\"language-text\">kernel.reset</code> are reset between requests, and that covers the big ones: Doctrine's entity managers (the identity map gets cleared), the security token storage, Monolog buffers. My first smoke test repeated the same public API requests, mixing authenticated and anonymous calls. The responses stayed stable and nothing leaked.</p>\n<p>Then I opened the real app in a browser to measure page loads (more on that below). In worker mode, a project with 400 tasks showed <strong>1,200 tasks</strong>, and more with every reload. Classic mode and php-fpm showed exactly 400 every time.</p>\n<p>The culprit was <code class=\"language-text\">PluginReturnHelper</code>, a service from the oldest layer of the codebase. Fifteen controllers use it to build their JSON responses. They add arrays to it, and it serialises everything it has collected. It never clears itself, because under php-fpm it never had to: everything died with the request. In a worker, one instance serves request after request, so <strong>each response carried the data of every earlier request on that thread</strong>. It wasn't only duplicates, either. <code class=\"language-text\">/app/projects</code> came back with the tasks from a project someone had opened before. Put two users on the same thread and one of them gets the other's data. I only checked this with one account, but the service has no idea who the user is, so the code alone tells you what happens with two.</p>\n<p>The fix was small: implement <code class=\"language-text\">ResetInterface</code>, tag the service <code class=\"language-text\">kernel.reset</code>, and Symfony clears it after each request. Finding it was the hard part, and that's the bit I'd most like you to remember:</p>\n<ul>\n<li><strong>My smoke test passed.</strong> It only hit the public API, and the public API doesn't use this service.</li>\n<li><strong>Searching the code didn't find it either.</strong> I'd looked for the obvious suspect, state in <code class=\"language-text\">static</code> properties, and found 19 classes. <code class=\"language-text\">MissingMemberHelper</code> caches <em>a user's role on a project</em>, <code class=\"language-text\">CachedExternalServiceAccessTokenProvider</code> caches ExternalService tokens, and <code class=\"language-text\">MirrorHelper</code> collects scheduled changes. I haven't audited those yet, and they're still suspect. But the bug that actually bit was an ordinary property on an ordinary shared service, and that describes most Symfony services.</li>\n</ul>\n<p>Under php-fpm, state lives \"until the end of this request\". In a worker it lives \"until the worker restarts\", which might be thousands of requests later and for somebody else. Symfony has no way of knowing which of your services hold request data unless you tell it.</p>\n<p>In fairness, Accesto Client's RabbitMQ consumers are long-running processes too, so some of this state already survives between messages today. But a consumer handles one kind of message on behalf of the system, while a web worker handles every user's requests. Switching Accesto Client to worker mode means auditing every shared service that collects data, not just the 19 static ones. It also means checking the bundles (FOSUserBundle and HWIOAuthBundle are older than worker mode) and testing the real app end to end with more than one user. That's a project, not a config change.</p>\n<h3>What a user actually sees</h3>\n<p>Requests per second tell you how a server copes under load. A user opening a project sees something else: the Angular 21 shell loads, fires 16 API calls, and then renders. I measured that with Playwright. A logged-in user opened projects with 30, 150 and 400 tasks, ten page loads per variant and size, with all the fixes above in place.</p>\n<p>To keep it close to production, the Angular bundle came from a separate static server playing the CDN (production uses a CDN too). TLS ended at a proxy playing the load balancer. Third-party scripts (fonts, analytics, chat) were blocked so that only our own servers counted.</p>\n<table>\n<thead>\n<tr>\n<th>Metric</th>\n<th align=\"right\">FrankenPHP worker</th>\n<th align=\"right\">FrankenPHP classic</th>\n<th align=\"right\">Apache + php-fpm + preload</th>\n<th align=\"right\">Apache + php-fpm (production)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>First Contentful Paint (any size)</td>\n<td align=\"right\">314-316 ms</td>\n<td align=\"right\">332-346 ms</td>\n<td align=\"right\">330-332 ms</td>\n<td align=\"right\">332-346 ms</td>\n</tr>\n<tr>\n<td>Project ready, 30 tasks</td>\n<td align=\"right\">473 ms</td>\n<td align=\"right\">525 ms</td>\n<td align=\"right\">502 ms</td>\n<td align=\"right\">527 ms</td>\n</tr>\n<tr>\n<td>Project ready, 150 tasks</td>\n<td align=\"right\">510 ms</td>\n<td align=\"right\">575 ms</td>\n<td align=\"right\">550 ms</td>\n<td align=\"right\">570 ms</td>\n</tr>\n<tr>\n<td>Project ready, 400 tasks</td>\n<td align=\"right\">590 ms</td>\n<td align=\"right\">630 ms</td>\n<td align=\"right\">645 ms</td>\n<td align=\"right\">641 ms</td>\n</tr>\n<tr>\n<td>Server time, sum of the 16 API calls</td>\n<td align=\"right\">~90 ms</td>\n<td align=\"right\">~210 ms</td>\n<td align=\"right\">~175 ms</td>\n<td align=\"right\">~200 ms</td>\n</tr>\n</tbody>\n</table>\n<p>\"Project ready\" is the moment every task title is on the page. Largest Contentful Paint comes within about 20 ms of it. The numbers are medians with a cold browser cache. A warm cache made no measurable difference on a local network.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1300px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/blog/static/cff58bb88bbcd57cfd88423318ed0812/07a9c/front_ready.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 91.07692307692308%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAACXBIWXMAABibAAAYmwFJdYOUAAADHklEQVQ4y42U71NUVRjH949zpjdZr2xGnclmohfllGXCiAaOQMwUCA6WlVPoxLRGzE68QBZBm6JQRE3SLDLce3dhfwDuL9jdu/fXfnrOuSwsWOnOfO73e889891z7nPuE/I8F8exScQNYo8fCX9jGo/1vRlbxBCWEgZxM4YhzxKiak48bpJKJTFNg0wmje97uK5DSF0Uy6tZEpksy2s5kk8Kcp9jaSWrUb7OkpBay7JRLlGtWpRFLauCWpgO9H1ZoevSGzE4emGBlq8CmrX+pan744MLvP35ApHrMWrrq9iyMxVUD9OB6l82igUeDn7I3Y/e4t6ZI/zaq3hnUxt9oA96D5P+podCLiuLcbbCdKB6fxvlDT6Y7uPQWDNvRE/QNN7K67toirbq8SZ5/upYCz/cH8UtV54O9DwPz63izh/DndmHe/OgcGAX+xv0IN6NV6jeeZdifk0KujtQLmrwdrLGjyb8FK8JjRr46bom4LpRY7GI/rmetzOwXu5L58f4uH2I/s7L9HWE/5OznWG628Lc/Po7mBujXMxLaENRVNkL+SzjkR7CX77H8MUWhgebn+bith+ROYNfHGU2fIbKShpLVXu7KA4Vq8Rn08c5deUAXdHX6Iwe+l/UnLYr+5mc66aUz+8ojC6K79mwPARGvzAA5sC2NvqtsXMQOwuJC3hWfkdhQr4XHOxL89BzA/pnoe85UPN6ZmAmXsWrqTBXr1SfQ6tS5trAeSKtpxht7+T7tmczKoyc7OLRJ904f8xSdtXxs6UopRJ5KcqnE320D7fQMXJCaOX0Jh3/onXfFTnJsaH3Offzt6xLjiuLk2Pjy7doM/PLm0yMv8DU1ZeYnHiRyat7A8RPbfqprbG6f5nJ6B5u3TpNcb0s21aBnqMNuT8hex8yd8WLrt4LyD3AT9+BJ78FujavfU3P+51aag6KpnQcS7+6UMXxsW2bqlvD9qHgQFXUcqGivAclGSiUbHLrFX2v5qlnMkWrROjtqkYTShpxaaLSPKWprmRS0useStNcJLm8RCJhSiM1SKeT8lqcANcO2NxZMOZstbF/ABaowz5v9Az7AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Chart of the time until every task is visible on an Accesto Client project in the browser\"\n        title=\"Accesto Client project load time in the browser\"\n        src=\"/blog/static/cff58bb88bbcd57cfd88423318ed0812/3c492/front_ready.png\"\n        srcset=\"/blog/static/cff58bb88bbcd57cfd88423318ed0812/ff46a/front_ready.png 325w,\n/blog/static/cff58bb88bbcd57cfd88423318ed0812/a6d36/front_ready.png 650w,\n/blog/static/cff58bb88bbcd57cfd88423318ed0812/3c492/front_ready.png 1300w,\n/blog/static/cff58bb88bbcd57cfd88423318ed0812/07a9c/front_ready.png 1440w\"\n        sizes=\"(max-width: 1300px) 100vw, 1300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>So in the browser, the 6-11x from the load test shrinks to <strong>30-60 ms, or 6-10%</strong>. Here's why:</p>\n<ul>\n<li>Worker mode cuts the server's share by more than half, from about 200 ms of PHP time to 90. But the 16 calls run in parallel, so the user waits for the slowest few, not for all of them added up.</li>\n<li>The first paint is the shell with a loading spinner, and it doesn't touch PHP at all. It takes 315-345 ms whichever server you use.</li>\n<li>Going from 30 to 400 tasks adds about 120 ms, nearly all of it in the browser. For 400 tasks the API returns half a megabyte of JSON, and Angular has to turn all of it into DOM.</li>\n</ul>\n<p>The client was an M3 Max on the same network as the server. On a mid-range laptop or a phone, the JavaScript takes longer and the server's share of the wait shrinks even further. What worker mode really buys you is capacity: the same hardware can serve several times more users before anyone has to wait. For one user on a quiet server, the improvement is small.</p>\n<h2>So, should you switch?</h2>\n<p>FrankenPHP is a good server. It's just not magic, and most of what people credit it with comes from somewhere else.</p>\n<ul>\n<li><strong>The speed comes from worker mode.</strong> Without it, FrankenPHP was within 10% of php-fpm on one app and 13-17% faster on the other. With it, HTML got 2-3x faster and light API calls 6-11x. If you don't plan to run the worker, performance isn't much of a reason to migrate.</li>\n<li><strong>Worker mode changes your application more than your infrastructure.</strong> On an app built for it, you get it for free. On a typical Symfony app that's a few years old, you need to audit static and per-request state first. Skip that and you get the nastiest kind of bug: rare, tied to particular users, and invisible in your tests.</li>\n<li><strong>Users notice far less than load tests suggest.</strong> On Accesto Client, 6-11x more throughput turned into a project that loads 6-10% faster. You're buying capacity, not a noticeably faster page.</li>\n<li><strong>Test worker mode on the real app, in a real browser.</strong> The leak that mattered showed up when I opened a project. A code search and an API smoke test both missed it.</li>\n<li><strong>Check what you're running today before you compare.</strong> Accesto Client production setup had OPcache preloading quietly switched off, and two Apache rule files did nothing. dynamiczne.info had no <code class=\"language-text\">php.ini</code> and Caddy was overriding the app's cache headers. A less careful benchmark would have given FrankenPHP the credit for fixes that take a few lines each.</li>\n<li><strong>Static files are slower.</strong> nginx and Apache served them 2-3.7x faster than Caddy. With a CDN in front, that rarely matters. If your PHP container also serves heavy assets, it does.</li>\n<li><strong>One config file isn't automatically simpler.</strong> Caddy's directive order (<code class=\"language-text\">php_server</code> before <code class=\"language-text\">file_server</code>, <code class=\"language-text\">respond</code> after <code class=\"language-text\">handle</code>) caused three of the bugs in this article. The Caddyfile is shorter than the Apache config, but it isn't any easier to get right.</li>\n</ul>\n<p>Would I move Accesto Client? Classic mode on its own gives a modest speed-up, one process instead of two, and more memory per instance. That's not worth a migration. The worker's 6-11x is worth a lot, but only once the state audit is done. I'd do that audit first anyway, since it pays off for the RabbitMQ consumers whatever web server you end up with.</p>\n<h2>Caveats</h2>\n<ul>\n<li>Two CPUs per container, one load generator, synthetic traffic. Your own mix of endpoints decides how much of the worker gain you'll actually see.</li>\n<li>The amd64 machine shares its host with other services, and repeated runs differed by up to 50%. Trust the ratios, not the decimals.</li>\n<li>Accesto Client ran on its small public-API test dataset. Its API numbers are mostly framework boot time, which flatters worker mode. Pages with heavy queries will gain less, as the month page on dynamiczne.info showed.</li>\n<li>The browser test ran from a fast client on the local network, with third-party scripts blocked and the websocket servers off. Real users add network latency and slower devices, which makes server differences matter even less.</li>\n<li>I didn't test HTTP/3, Early Hints or Mercure. They're real FrankenPHP features, but they're a different question.</li>\n</ul>","timeToRead":17,"frontmatter":{"title":"FrankenPHP vs PHP-FPM: What We Learned Benchmarking Two Real Symfony Apps","tags":["php","symfony","frankenphp"],"author":"pawelc","categories":["for-developers"],"dateUpdated":null,"customTopics":[["How to Audit PHP","/how-to-audit-your-php-codebase","blog"],["Tuning PHP","/php-performance-tuning","blog"],["PHP OpCode Caching","/php-opcode-caching","blog"],["PHP App Review","https://accesto.com/services/php-application-review/","services"]],"customCTA":["Hire PHP modernization experts","https://accesto.com/services/php-upgrade-services/","Improve Code"],"customContactCTA":["Hire PHP modernization experts","We work fast and effective, in parallel with releasing new features. Free code review included.","Improve Code","https://accesto.com/services/php-upgrade-services/"],"customContactCTAIcon":null,"heroImage":{"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsTAAALEwEAmpwYAAABpklEQVQoz4WP227TQBCG/W5IvEx5Aa5R1ReAC0BColcEuECAnFCSpqZJSuI4Th03prGd1G7T2PGh3rXXh3htM8gIcQOVPo3+mdl/doaxg/ReHJz9Reon5XKNN37MOCj7Py7O4N3GJZYXr53QDstB8+TVoz3VRAz0AAelW/gBpbWuPYAX7jYe+c4vTjjp26ncH8yHvP762fuX+09tTBlo+1GOkwKnRUBySFFC/QiKOy/MgpiaFj6XjW5X6nTEfm/+pTne2OHntmTD2mBQVPtsqPcGWpf7IUxNdekOznReuDrtq+YNgo1msjGVjAvN0ddYkq8tK2Bbo+1dwpC0WJn++exmIprCxFiojjRbzxVrJt9Cqumu60baamstVwu2oTUbk+NeEBC2NfZxxkRJEcYURTmKaIB3mIDIIQZwDsoikj9+znWGV1Qb2U8eOAcPx41Dz8VH7cldbQZIWsZZCbHWNVBJdtWLd2OuP/c8LAqXIq8oFyvDtN+85RDJf5v/DS3LSrm8/cjyza8ieyS22tMPn4YjQYe595p/HZXRsqiqP5RVldMqTIqfdOcagmaP1dwAAAAASUVORK5CYII=","aspectRatio":1.9736842105263157,"src":"/blog/static/67a77bc0232178ed5fb6e08a60cf651a/f3583/frankenphp_vs_php_fpm_hero.png","srcSet":"/blog/static/67a77bc0232178ed5fb6e08a60cf651a/630fb/frankenphp_vs_php_fpm_hero.png 300w,\n/blog/static/67a77bc0232178ed5fb6e08a60cf651a/2a4de/frankenphp_vs_php_fpm_hero.png 600w,\n/blog/static/67a77bc0232178ed5fb6e08a60cf651a/f3583/frankenphp_vs_php_fpm_hero.png 1200w,\n/blog/static/67a77bc0232178ed5fb6e08a60cf651a/7adbf/frankenphp_vs_php_fpm_hero.png 1660w","sizes":"(max-width: 1200px) 100vw, 1200px"}},"publicURL":"/blog/static/67a77bc0232178ed5fb6e08a60cf651a/frankenphp_vs_php_fpm_hero.png"}},"fields":{"date":"2026-11-17"}},"authorImage":{"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAUDAf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAGzItSZbLixmGoP/8QAHRAAAQQCAwAAAAAAAAAAAAAAAgABAxEEEBITMf/aAAgBAQABBQKa+oDOPJRecXGZntOqvX//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAECAQE/AR//xAAcEAACAgIDAAAAAAAAAAAAAAABAgAREiEQIGH/2gAIAQEABj8CNGvYq5llbW+KitjYE10//8QAHBABAAMAAgMAAAAAAAAAAAAAAQARIRAxQVGh/9oACAEBAAE/IQhd+niP55a18VWnuG5i/YAtWQDsAtgUZP/aAAwDAQACAAMAAAAQN8cA/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREg/9oACAEDAQE/EAI4/8QAFhEAAwAAAAAAAAAAAAAAAAAAASAx/9oACAECAQE/EDU//8QAHBABAAICAwEAAAAAAAAAAAAAAQARITEQQVGh/9oACAEBAAE/EGgOvQWX8lQULUHqvHg0wRitxOt0nYDefGByJpJlGyUO6EAAAHRP/9k=","aspectRatio":1,"src":"/blog/static/6127f3dd80b5f4a0a5aa24adacfafff1/ea649/pawelc.jpg","srcSet":"/blog/static/6127f3dd80b5f4a0a5aa24adacfafff1/b1092/pawelc.jpg 11w,\n/blog/static/6127f3dd80b5f4a0a5aa24adacfafff1/1d7ec/pawelc.jpg 21w,\n/blog/static/6127f3dd80b5f4a0a5aa24adacfafff1/ea649/pawelc.jpg 42w,\n/blog/static/6127f3dd80b5f4a0a5aa24adacfafff1/1c2ab/pawelc.jpg 63w,\n/blog/static/6127f3dd80b5f4a0a5aa24adacfafff1/567fa/pawelc.jpg 84w,\n/blog/static/6127f3dd80b5f4a0a5aa24adacfafff1/e90d9/pawelc.jpg 880w","sizes":"(max-width: 42px) 100vw, 42px"}}}},"pageContext":{"slug":"/frankenphp-vs-php-fpm/","authorImagePath":"pawelc.jpg"}},"staticQueryHashes":["1607616503","473848531"]}