Skip to content

QUAL Make API Explorer work under FrankenPHP#38107

Draft
JonBendtsen wants to merge 4 commits intoDolibarr:developfrom
JonBendtsen:frankenphp_api_explorer
Draft

QUAL Make API Explorer work under FrankenPHP#38107
JonBendtsen wants to merge 4 commits intoDolibarr:developfrom
JonBendtsen:frankenphp_api_explorer

Conversation

@JonBendtsen
Copy link
Copy Markdown
Contributor

QUAL Make API Explorer work under FrankenPHP
Applying this PR will make the API explorer work when running using FrankenPHP which is explored here Dolibarr/dolibarr-docker#98

Also tested in regular Apache setup for the develop branch and it also worked.

@defrance
Copy link
Copy Markdown
Contributor

defrance commented May 6, 2026

Hello John, it seems that Franckenphp is faster than other PHP servers. Have you done any tests in this area? What were the results?

@JonBendtsen
Copy link
Copy Markdown
Contributor Author

JonBendtsen commented May 6, 2026

Hello John, it seems that Franckenphp is faster than other PHP servers. Have you done any tests in this area? What were the results?

Yes @defrance I currently doing some tests

Running in purely CGI mode, not worker mode of FrankenPHP, my test script states that I get about a 35% speedup with FrankenPHP.

All tests are done with HTTPS, though without any Certificate check.

@defrance
Copy link
Copy Markdown
Contributor

defrance commented May 6, 2026

Very interesting.
Since I have to teach a Docker course in early June, I'm going to ask my students to replace PHP with FrankenPHP in my Dolibarr development repository as a practical exercise, and to run a benchmark with random loading.

@JonBendtsen
Copy link
Copy Markdown
Contributor Author

Very interesting. Since I have to teach a Docker course in early June, I'm going to ask my students to replace PHP with FrankenPHP in my Dolibarr development repository as a practical exercise, and to run a benchmark with random loading.

sorry @defrance I spoke too fast, the 12x14 speed gain is because FrankenPHP api calls doesn't save any data. after doing some data sanitfy checks, they were empty :-(

but 35% aka 1,35 is still good gain

@JonBendtsen JonBendtsen force-pushed the frankenphp_api_explorer branch from 66e4b25 to a96527d Compare May 6, 2026 14:20
Comment thread htdocs/api/index.php Outdated
if (preg_match('#^/api/index\.php(.*)$#', $uri, $matches)) {
$path_info = $matches[1];
} else {
$path_info = $_SERVER['PATH_INFO'] ?? $_SERVER['ORIG_PATH_INFO'] ?? '';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add parenthesis here so there is no doubt of which test is done first ?

@JonBendtsen
Copy link
Copy Markdown
Contributor Author

Very interesting. Since I have to teach a Docker course in early June, I'm going to ask my students to replace PHP with FrankenPHP in my Dolibarr development repository as a practical exercise, and to run a benchmark with random loading.

sorry @defrance I spoke too fast, the 12x14 speed gain is because FrankenPHP api calls doesn't save any data. after doing some data sanitfy checks, they were empty :-(

but 35% aka 1,35 is still good gain

and now I can't even reproduce that :-(

@JonBendtsen
Copy link
Copy Markdown
Contributor Author

Yesterday I compared php8.2 on debian bookwork with frankenphp on php8.4 on debian trixie - that might also explain some speed difference.

Today I am looking at frankenphp on 8.2, but still on debian trixie :-(

@JonBendtsen
Copy link
Copy Markdown
Contributor Author

I think there might be a small gain ~25% when running dolibarr under FrankenPHP in CGI mode, but it is perhaps better than throughput is that FrankenPHP works better under load.

But notice that I mostly checked API performance and not GUI performance.

Apache's P99 of 2.74s means 1 in 100 users waits nearly 3 seconds.
FrankenPHP's P99 of 0.56s means 1 in 100 users waits half a second.
In production, FrankenPHP is the safer bet. A 2.7s freeze is a user complaint; a 0.5s delay is often unnoticed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants