D
D
Dmitry Rodin2021-02-14 17:50:57
Nginx
Dmitry Rodin, 2021-02-14 17:50:57

Website optimization for PageSpeed ​​Insights requirements. How to fix long server response 650 ms?

Site capmex.ru . The Joomla engine, highly modified, working with subdomains, the joomshopping component is installed, about 6000 products, 220 cities, prices are generated individually in each city. Good VPS server.

Before the start of optimization, the site's PageSpeed ​​Insights indicators were as follows: 5/20 (mobile/PC), unfortunately I forgot to take screenshots right away, and then it was too late when I remembered.

What has been done on the main page (after the main optimization will go to the category and product pages):
1. Compressing all loaded css, js files
2. Combining css files
3. Compressing images. I do it with a service
4. In nginx, the maximum gzip compression is set to 9, it didn't seem to have much effect on performance. Previously, the compression value was set to 1. A few more settings were added to nginx, which seem to increase performance, but this was not noticeable in tests. Added file formats that need to be compressed, not all of them were previously registered.

gzip_types text/plain text/css text/xml application/json text/javascript application/x-javascript application/javascript application/msword application/rtf application/pdf application/vnd.ms-excel application/xml+rss image/x-icon image/svg+xml application/x-font-ttf;

5. A number of recommendations from PageSpeed ​​Insights have been implemented, font preload links have been added.
6. In the database, I cleaned some tables that are not used, session, etc. I also want to dump and globally clean Joomla from all long-installed plugins, components, modules that are not currently involved.
7. Widgets and scripts for analytics and metrics, also pixels, for them a module position was created on the site at the very bottom, before the closing body tag. Added delayed loading to this module. This gave an increase, but as I understood this method is not very optimal, it will be possible to get confused later on this issue more seriously.

After all these not tricky operations, the performance indicators for PageSpeed ​​Insights became the following: 30/60 (mobile / PC).

Now the main difficulty faced is the long server response:
The server response time for the main document should be fast, because all other requests depend on this indicator. Time spent: 650 ms

I am looking for information on this issue, there is very little of it. If someone came across and solved this issue, please give a hint where to dig.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
ky0, 2021-02-14
@ky0

Turn on logging requests to the database and see how many of them (and for how long) are executed when entering the page and the main actions - pressing buttons, etc. Most likely, you will find your 650 ms right there. Reducing the number of calls to the database and improving the speed of its response is usually the first candidate for optimization. Well, caching, of course, yes.

G
ge, 2021-02-14
@gedev

Duty reminder . See paragraph 5.12.
According to TTFB measurements , it's really sad. Something slows down the site even at the page generation stage. From experience, the bottleneck is most often the database.
For the Nginx + PHP-FPM bundle, you can add the FastCGI cache .
You can also try tweaking the database .
But first, try running index.php through the console and see what goes wrong. How long he thinks ( time ). You can run it through strace to see in more detail (analysing strace requires preparation).

N
Nadim Zakirov, 2021-02-14
@zkrvndm

Try connecting caching with Cloudflare, this will take the load off the server in terms of generating pages, otherwise now your server actually does a lot of work every time to assemble the page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question