-
-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Allows disabling root symlinks #1001
Conversation
I just realized that in worker mode the value of resolveRootSymlinks is always true since worker mode seems to reference the global Lines 249 to 252 in 4a85555
|
I think the most plausible reason for this behavior is that I forgot to add the needed config! This isn't intended, we should expose a config for that in the "worker" global block. Would you mind to add it? I think that we should keep the default to true, because many tools rely on symlinks and because it would be a breaking change to change. |
After reading the code a second time, I think this is a leftover of some tests. Removing these two lines should be enough to fix the bug: https://github.com/dunglas/frankenphp/blob/main/caddy/caddy.go#L330-L331 (still, we must handle the error case too). |
I removed the 2 lines and yeah it works now 👍
|
I do have some other small ideas that I might look into in the future based on these flamegraphs (created from the 'Lock Free Handles' branch):
|
Thanks for your research! For the fileserver hit, I don't know how we can improve this, but maybe @francislavoie or @mholt will have an idea. For Zap, wrapping all calls with the
I've no specific idea for |
The filesystem hit is why we have it off by default in Caddy itself for |
@francislavoie thanks for the hint! Having the file server available is convenient and needed for the default setup of Laravel and Symfony, so I propose to keep it by default (especially because it's possible to disable it for maximum performance). However, we should update our benchmarks as well as the TechEmpower benchmark to use the I'll try to add a "performance" docs entry to compile all these tips. |
Thank you very much for this fix @AlliBalliBaba! |
Currently this configuration in the Caddyfile will always throw an error if
resolve_root_symlink
has a second argumentThis pull request fixes the behaviour, so it works in accordance to the docs and allows disabling checking for symlinks.
Not checking for symlinks actually makes a 'Hello World' in frankenphp about 5% faster as you can see in the following flamegraph (
path/filepath.EvalSymlinks
):