H
H
hehog22015-09-08 21:12:27
PHP
hehog2, 2015-09-08 21:12:27

Optimizing nginx, php-fpm, postgresql for high load?

Welcome all!
I ask you to give advice about the optimal configuration of the software on the server. I would like not to miss anything when setting up and use the server to the fullest. We do not hire a specialist, because I'm interested in the details myself (I'm a coder) :)
Hardware:
Intel® Xeon® E5-2670v2 (2x)
20 Cores / 40 Threads
2.5 GHz (3.3 GHz Turbo)
256 GB DDR-3 ECC
500 GB SSD
Software: nginx, php -fpm, postgresql, redis (as cache)
The database size is very small, the largest table is 300k records, the rest are several hundred records. Site traffic - 500k. unique and 1 million views per day. 99% of all records in a DB will occur in one table. The overall read / write ratio in the database is approximately 20% to 80%.
What settings should you pay attention to first of all and what to read on this topic?
Thanks a lot!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Nikiforov, 2015-09-08
@eoffsock

There is a good thing about postgresql: postgresql.leopard.in.ua
For the rest, here is the material: ruhighload.com/server
There, insofar as, of course, but there may be something useful.
In php, I think they will also tell me here, I'm not special here.

V
Valentin, 2015-09-09
@nowfine

the main thing is the number of nginx and php-fpm workers
and their memory usage settings. I don’t remember the details, but everything is in the usual manuals

A
Andrei, 2015-09-19
@andreyvlru

Each component of your system requires a separate analysis.
In general, with a simple, competent setup, you have more than enough resources to serve the specified traffic, unless you do complex groupings or nested queries on the go.
The server that you brought it is most likely even redundant, why do you need so much memory if the database is quite small?
Allocate enough memory to mysql, redis.
Check your network settings to make sure they are set to a high number of
nginx, php-fpm connections - everything is standard enough for your load.
In the process of work, you yourself will see bottlenecks, but in general, your hardware is powerful and can forgive quite a lot of mistakes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question