Closed dunglas closed 1 week ago
No, but this will have the same effect.
php_server
with file_server off
will still do try_files
(maybe this can be optimized in Caddy?).
The fastest configuration is just using php
with a rewrite
to the index file
Here's what I'm getting:
~66000 RPS
php_server {
root /go/src/app/testdata
file_server off
enable_root_symlink false
}
~88000 RPS (+33%)
php {
root /go/src/app/testdata
enable_root_symlink false
}
That's with 40 workers on the newest Caddy version. With 8 workers I can get up to 120.000 RPS (worker mode), which is half as fast as Caddy's 'Hello World'.
Not related, but would you mind to run the benchmark with 1.2.5 to compute the improvement? Thank you!
IMHO we shouldn't do a try_file
if the file_server
directive is off. It's likely a bug in our code.
As discussed privately with @francislavoie, @mholt, and @mohammed90 (thank you), we should cache the result of the resolved and sanitized path instead of computing it for each request.
Here's the flamegraphs for reference:
With php
With php_server
The improvement is felt most with the ideal amount of threads and the new Caddy beta (but it's kind of a fake benchmark). I'll put something together once I'm back from vacation at the end of the week with some more realistic scenarios.
Closing in favor of https://github.com/dunglas/frankenphp/pull/1154.
Have you also tried benchmarking with
php
instead ofphp_server
?