G
G
giggigi2013-05-29 12:08:13
PHP
giggigi, 2013-05-29 12:08:13

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

2 answer(s)
S
script88, 2013-05-29
@script88

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.

@
@sledopit, 2013-05-29
_

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 question

Ask a Question

731 491 924 answers to any question