Open wiseguy1394 opened 3 days ago
Hard to say, but there's probably room for improvements. Are all your static files behind /build/*
? In that case you could specifically call the file_server
on those paths and see if that improves performance. It would certainly reduce the number of file checks. You could even handle static files before checking for maintenance, thus removing another try_files
check.
@staticFile path /build/*
handle @staticFile {
file_server
}
@maintenance .......
If all your php requests go toyour worker file, you could then even use php
instead of php_server
like this:
# at the very bottom
rewrite /var/www/public/index.php
php
For better performance you should ofc also remove debug
logs.
Thanks for your tips.
Performance is better, but still really slow. It seems, that the php requests are also slow. If I do a load test with 200 Connections I get following numbers: avg=1.02s min=251.59ms med=919.47ms max=9.76s p(90)=1.56s p(95)=1.8s The range is really big and I have no idea why.
The Server is a Kubernetes Deployment with 3 CPU and 2Gi Memory and I'm runnig a symfony application. If I monitor the deployment max CPU used is 250m from 3000m available. I've tried multiple worker numbers 6, 12, 16, 32, 64 ... there are no big changes except the max value gets smaller. Is there anything wrong with my configuration? Tideways logs for php request nearly the same ranges 60ms - 8s, but the server load is still small.
You say that you've increased the number of workers and haven't seen any performance changes? Do you get significantly better performance with lower numbers of requests? Like if you were to plot it -- with x-axis being number of requests and y-axis being time or rps, it would look like a steep cliff, a curve, or a straight line.
A steep cliff would indicate you've got some global locks or something similar somewhere, preventing you from handling more than one (or some other low number) request at once. This could be in an extension or your own code.
A curve indicates that there is contention for resources somewhere. This could be anything.
A line indicates everything is fine (generally performance should scale linearly until you hit contention for cpu/memory resources).
@wiseguy1394 have you also tried completely turning off logging?
What happened?
I have the following Caddyfile:
When to server load increases the response time for static files increases 40ms to in some cases 10s. Could my Caddyfile be optimized ? Or am I triggering some unexpected behaviour?
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
Relevant log output
No response