Closed numerogeek closed 2 days ago
Does this affect the default template, or a more advanced app?
If it's the later, would you be able to provide us a reproducer?
This looks a bit like https://github.com/dunglas/frankenphp/issues/1010
It's a random guess, but could you try if it's as slow when using curl, and when disabling compression entirely?
Hello @dunglas,
Thanks for your suggestion. Here’s a short video showing how it behaves: https://www.youtube.com/watch?v=_lH1QE_HCuo. It's a fresh symfony install used for a SymfonyCast tutorial, nothing big here.
On the browser side, the load times are long, but when I test with curl, the performance is better, although still quite slow. I’ll look into disabling compression, which I believe is in the Caddyfile, right ?
Thanks in advance !
I tried removing this line encode zstd br gzip
in the Dockerfile, then rebuilt and restarted the container, but I’m getting more or less the same results.
I don't know if it's related but the SERVER_NAME
value looks weird.
Are you using a Mac?
You can disable encoding in the Caddyfile, indeed (the encoding
) line.
Also, I'm curious to see the code of this "picture" endpoint.
Yes, I'm using a Macbook Pro M2. Why does it look weird to you ?
It's a super basic project following the upload tutorial on sfcast: it's just a make:crud
with a file upload : I just pushed the code here if you want to have a look: https://github.com/numerogeek/linkedinPP
Okay, you pointed me in the right direction.
I changed the server name to server-name.localhost
and it’s instant now. I was using server-name.local
and modifying the hosts file to redirect server-name.local
to 127.0.0.1, which seems to have been causing the issue.
I used your template and did a new fresh install without adding any code, and indeed, with the server name set to .local it’s very slow, but with .localhost everything works fine. I can’t explain why, but at least it’s working now.
Thanks for pointing me in the right direction!
Maybe an explanation : your .local
is likely triggering mDNS resolution, which causes the slowdown, even with the hosts file configured. On the other hand, .localhost
bypasses mDNS and directly points to 127.0.0.1, making it faster.
@maxhelias Thank you for the explanation. Good to know. Although I’m surprised that the MDNS Resolution takes so long.
Hello,
Since switching to frankenPHP, I’ve noticed a significant performance drop in the Docker template. Specifically, I have a Symfony installation running on PHP, and the page load time has jumped to 40 seconds. This seems highly unusual as the Symfony profiler shows an execution time of only 175 milliseconds.
However, when I check Chrome’s Network tab, it consistently reports 40 seconds for every page refresh. I’ve already uncommented the necessary line
- /app/vendor
in compose.override.yaml, but this doesn’t seem to resolve the issue.For reference, I’m running this setup on a MacBook Pro M2. Any insights or suggestions on what might be causing this slowdown would be greatly appreciated.
Thanks in advance for your help!