Answer the question
In order to leave comments, you need to log in
How to scale the system to reduce the load?
Hello!
We have a server running nginx + php-fpm + mysql on it.
We faced a problem: traffic increased, loads increased.
MySQL is clogged with a large number of queries, as a result of which even selections by PRIMARY KEY began to get into slow queries.
I would like to understand how it is possible to scale the system in order to distribute the load? What are the ways to do this?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Well, at least you can deploy 1 more application server and 1 mysql server, connect the server app (php-fpm) to nginx upstream, configure mysql master-master, thereby the load will be distributed between the servers.
On heavy loads, I advise you to use percona server instead of msyql,
P.S. in addition to the server infrastructure, it is necessary to optimize the application itself.
Without a picture of the real distribution of the load (monitoring), this will be a little fortune-telling on the coffee grounds.
Most likely, both nginx and mysql actively eat the disk and interfere with each other.
IMHO, the first step would be logical to move mysql to a separate physical disk or, if this is not enough, even a separate physical server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question