Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, FrankenPHP, Mercure.rocks, Vulcain.rocks and of some Symfony components.

Menu
  • Talks
  • Resume
  • Sponsor me
  • Contact
Menu
FrankenPHP 1.5 and 1.6

FrankenPHP’s New Features: Thread Autoscaling, Mostly Static Binaries, deb and RPM Packages, Caddy 2.10…

Posted on May 19, 2025May 19, 2025 by Kévin Dunglas

FrankenPHP 1.5 and 1.6 (released today) contain many major features and fixes that greatly improve the usability and performance of the project!

Let’s review some of them.

Thread Autoscaling

Until now, it was necessary to statically define the number of threads that FrankenPHP uses to handle PHP requests. By default, FrankenPHP starts two times more threads than the number of CPUs on the machine: this is often not optimal. The proper number of threads to start depends heavily on your application itself and your hardware. We provide extensive documentation explaining how to find the best suitable value.

Starting with version 1.5, Alexander Stecher added a new way: thread autoscaling. When using this mode, FrankenPHP will automatically spawn additional threads at runtime up to a specified limit. This new max_threads directive can help you figure out how many threads you need to handle your traffic and can make the server more resilient to latency spikes. If set to auto, the limit will be estimated based on the memory_limit set in your php.ini. This new mode is similar to PHP FPM’s pm.max_children.

Read the related documentation

Maximum Wait Time

Alexander also added a new option to limit the time a request can be buffered, waiting for a PHP thread to be available. This helps the server to recover faster during latency spikes by not allowing an endless accumulation of queued requests.

When the new max_wait_time is set, if the timeout is reached, a 504 “Gateway Timeout” error will be returned.

Mostly Static, glibc-based Static Binaries

One of the key features of FrankenPHP is that it can be downloaded as a fully static binary that contains FrankenPHP itself, a web server (Caddy), the PHP engine, the most popular PHP extensions, and their dependencies.

This means that you can execute FrankenPHP by downloading a single executable file containing everything without having any system dependencies.

This fully static binary is using the musl-libc and PHP has some known issues when using musl (especially with OpenSSL). Also, musl is known to be slower than the GNU libc in some circumstances.

static-php-cli, the tool that FrankenPHP uses under the hood to create its static builds, recently gained the ability to build “mostly static” versions of libphp. This means that all required system libraries are statically linked (so they don’t have to be installed on the system), except the libc itself. Thanks to this trick, FrankenPHP will link against the local installation of the GNU libc, which is available by default in most popular GNU/Linux distributions.

Since FrankenPHP 1.5, thanks to Jerry Ma and Marc “henderkes” (who are also the authors of this feature in static-php-cli), we provide mostly static builds of FrankenPHP that can be downloaded directly from the GitHub releases (the frankenphp-linux-<arch>-gnu files).

In addition to better stability and performance, Mostly Static builds also have the benefit of being able to load dynamically built PHP extensions, including Xdebug and FFI, which are not supported by musl-based builds!

Debian/Ubuntu and RedHat Packages

Mostly Static binaries also unlocked another feature that has also been contributed by Marc “henderkes”: official RPM and deb packages!

In addition to the Homebrew packages, starting from FrankenPHP 1.6, packages for Debian/Ubuntu and RedHat are built in the CI and provided in the GitHub releases!

In the future, package repositories will be set up (help welcome!).

Site-Specific Workers

Marc (he’s on fire!) also added the ability to define workers for a specific site instead of globally for all sites. This enables us to write a Caddyfile like this:

{
    frankenphp
}

one.example.com {
    php_server {
        root /var/www/app-one
        env APP_NAME one
        worker index.php 16 # 16 instances of the worker script will run in parallel
    }
}
two.example.com {
    root /var/www/app-two
    php_server {
        env APP_NAME two
        worker {
            file index.php
            num 8 # 8 instances of the worker script will run in parallel
        }
    }
}

Caddy 2.10

FrankenPHP 1.6 is now built on top of Caddy 2.10. This brand new version of our favorite web server comes with a bunch of new features, including Encrypted Client Hello, post-quantum (PQC) key exchange or global DNS providers.

Support The Project

This week, Les-Tilleuls.coop, the PHP Foundation and the Caddy team announced that FrankenPHP is now officially supported by the PHP Foundation.

Also, many talks about FrankenPHP have been announced at the API Platform Conference, in September in France. Be sure to be there, to meet some of the main contributors of the project will too!

To support the project, please contribute, give it stars on GitHub, and sponsor me!

Related posts:

  1. FrankenPHP 1.3: Massive Performance Improvements, Watcher Mode, Dedicated Prometheus Metrics, and More
  2. PHP and Symfony Apps As Standalone Binaries
  3. FrankenPHP Is Now Officially Supported by The PHP Foundation
  4. The PHP Revolution Is Underway: FrankenPHP 1.0 Beta

Leave a ReplyCancel reply

Social

  • Bluesky
  • GitHub
  • LinkedIn
  • Mastodon
  • X
  • YouTube

Links

  • API Platform
  • FrankenPHP
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks

Subscribe to this blog

Top Posts & Pages

  • FrankenPHP’s New Features: Thread Autoscaling, Mostly Static Binaries, deb and RPM Packages, Caddy 2.10…
  • FrankenPHP: The Modern Php App Server, written in Go
  • FrankenPHP Is Now Officially Supported by The PHP Foundation
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • FrankenPHP 1.3: Massive Performance Improvements, Watcher Mode, Dedicated Prometheus Metrics, and More
  • Securely Access Private Git Repositories and Composer Packages in Docker Builds
  • Develop Faster With FrankenPHP
  • Symfony's New Native Docker Support (Symfony World)
  • PHP and Symfony Apps As Standalone Binaries
  • How to debug Xdebug... or any other weird bug in PHP

Tags

Apache API API Platform Buzz Caddy Docker Doctrine FrankenPHP Go Google GraphQL HTTP/2 Hydra hypermedia Hébergement Javascript JSON-LD Kubernetes La Coopérative des Tilleuls Les-Tilleuls.coop Lille Linux Mac Mercure Messagerie Instantanée MySQL performance PHP Punk Rock Python React REST Rock'n'Roll Schema.org Security SEO SEO Symfony Symfony Live Sécurité Ubuntu Web 2.0 webperf XHTML XML

Archives

Categories

  • DevOps (85)
    • Ubuntu (68)
  • Go (19)
  • JavaScript (46)
  • Mercure (7)
  • Opinions (91)
  • PHP (172)
    • API Platform (77)
    • FrankenPHP (11)
    • Laravel (1)
    • Symfony (97)
    • Wordpress (6)
  • Python (14)
  • Security (15)
  • SEO (25)
  • Talks (46)
© 2025 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme