A
A
Alexander2021-03-23 18:02:00
Nginx
Alexander, 2021-03-23 18:02:00

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.

67629006cc.png
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

2 answer(s)
R
rPman, 2021-03-23
@librown

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

K
ky0, 2021-03-23
@ky0

I wouldn't call the conditions "equivalent".
Just installing nginx and php-fpm instead of Apache is not enough to guarantee a performance boost. You need to look at how it was set up, how it is set up now, turn the knobs, profile ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question