Answer the question
In order to leave comments, you need to log in
How to improve website speed under load?
Good afternoon, there is a project written in laravel, now the site pages are loaded in 15 seconds, we get a lot of different data from mysql, how to improve the situation? the received data is not often updated, I thought about redis, but here the problem is that the project works on several servers and I’m still afraid that over time there won’t be enough space to put everything in redis.
I will be glad of any help, if you need more information, write what you need, I will answer.
Answer the question
In order to leave comments, you need to log in
Your 15 seconds, I'd like to see a breakdown of what they add up to.
Requests to the DBMS, how many of them are?
Number of queries to the database needed to generate the page?
First, check that you have not forgotten the indexes.
We read the link on how to analyze the optimality of requests
https://habr.com/post/211022/
Then we think about what is wrong. For example, I saw a project that had 2000 requests to generate the main one. The mistake was that the authors took out 15 news like this.
Find the last 15 IDs. Call the news constructor 15 times. In the constructor, make a request to the database by the
passed id.
You didn't write anything about mysql version and table engine. It is worth checking my.cnf for optimal values.
Is it possible to use Query Cache ?
Write in more detail how the project is distributed across servers.
What? where? Server configuration (Processor, cores, frequency; RAM, volume, type; HDD / SSD, volume / speed for reading / writing)
More about the DBMS. How many total volume, tables, records on tables.
If the DBMS is already on several servers, then the type of replication.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question