C
C
Chvalov2018-06-24 02:55:27
MySQL
Chvalov, 2018-06-24 02:55:27

How to properly tune database configs, allocate resources?

I got a little confused with the configs, or rather with the distribution of resources.
There is a server with 32GB of RAM, 4 cores at 3.2GHz, 2TB HDD in the raid
Installed: PHP-FPM, MySQL, Postgresql, Nginx
I read about configs on ruhighload
Let's start with Postgresql:
shared_buffers:

should be set to 15..25% of all available RAM

effective_cache_size:
should be set to 50%...75% of all available RAM

Next MySQL:
innodb_buffer_pool_size
should be set to 70% ... 80% of all available memory

How to properly allocate resources in configs so that everything works fine and does not offend anyone with tightness?
After all, if Postgresql and MySQL are allocated RAM according to such an instruction, I’m not sure that they will work normally under the same loads.
Here, according to the instructions, all 100% of RAM is allocated only for Postresql, such a config is only suitable if the server only has postgres running and no more.
Is there a way to more reasonably allocate resources on the server, monitoring the loads from which to subsequently draw conclusions and allocate resources to those processes that are more used?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Melkij, 2018-06-24
@melkij

Here, according to the instructions, all 100% of RAM is allocated only for Postresql, such a config is only suitable if the server only has postgres running and no more.

Exactly. Because you are reading about highload. A separate physical host is allocated for the DBMS, plus a couple more of the same for replicas. And certainly not with mechanical io. highload DBMS on HDD does not exist for a very long time.
Put both configs at the rate of 16GB of memory. You're still stuck on the disks. Yes, and in the CPU, too, rest.
If you set shared_buffers to 25% ram, and innodb_buffer_pool_size to 80%, then only one of the databases will run corny. Well, or the buffer will be permanently in the swap, which, in general, is even worse.
By the way, I hope you at least check the meaning of the settings being changed. So that there are no interesting surprises, it seems that they made the entire database on myisam, but turn innodb_buffer_pool_size

D
Doc44, 2018-07-24
@Doc44

Profile first.

M
Max, 2018-06-24
@MaxDukov

start by understanding how much data and in which databases you have. And then you will start giving memory to Postgres, storing the main data in the Muscle.
the muscle has a separate song - engines. You write about innodb - do you store it in it?
In short, the first step is to collect statistics.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question