Answer the question
In order to leave comments, you need to log in
Why is there such a difference between Nginx and Apache in the "Content Download" metric?
The project worked on a bunch of "Nginx + Apache + mod_php". The statics was given by nginx, all scripts were processed by Apache.
Now on the same server raised "Nginx + PHP-FPM 5.6".
Both web servers have gzip and http2 enabled.
To compare the speed of work, I set up a separate test location, so the testing conditions are equivalent. But the results are strange:
1. TTFB - dropped by 7 times (it was expected and it's great)
2. But "Content Download" jumped sharply.
It seems that this should not be so - since the Apache could give back at such a high speed - it means that the channels physically allow it. Colleagues, tell me, because of what this can happen?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Most likely it all depends on how applications give http headers.
When working through apache, TTFB waits a long time because until the application finishes, even the headers will not be sent, i.e. the time it takes for the application to work is TTFB + content download
When it works via php fpm, headers are sent immediately, nginx does not wait for the application to finish working for this, which means TTFB is small (by the way, 122ms is LONG, what's going on there?) and already content generation occurs while content download is in progress
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question