M
M
Michael2020-01-20 01:25:56
ubuntu
Michael, 2020-01-20 01:25:56

How to properly allocate RAM on a VPS?

Hi all!
transferred all projects to a slightly powerful server (vps) and now I would like to ask the respected community for advice on how to give maximum RAM (8 GB in total) to such basic services as:
1. mysql - 5.7.28
2. Nginx 1.14.0
3. Php7 .2
4 Php7.2-fpm

OS Ubuntu 18.04.4
SSD 80 Gb

All listed services work on default settings (as long as the system is clean)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
Pavel Mezhuev, 2020-01-20
@happy-cat

The default MySQL settings are designed to work with 512 MB of RAM ( How MySQL Uses Memory ) and for efficient use of resources, it must be configured for the planned load. PHP-FPM memory consumption depends on the number of worker processes, see process manager settings (pm.* parameters). It's the same with nginx.

V
Vitaly Karasik, 2020-01-20
@vitaly_il1

I agree with Andrey Mikhalev - give mysql 4GB and see what happens. (Provided that the database is "large". If the database is 100MB, it makes no sense to give 4GB)

A
Andrey Mikhalev, 2020-01-20
@Endru9

Everything is relative. We don’t know how many users you have, what site engine you have, how many connections to the database open as much as possible. All this needs to be analyzed, calculated and adjusted to your site / project.
Allocate no more than 4 GB of RAM to start mysql.
Don't touch the rest yet, because. need to monitor the behavior of memory on the server in production mode.
Graphs of resource consumption either from the hoster or from zabbix will help here best of all.

K
Karpion, 2020-01-20
@Karpion

If these services are running on the same computer (not separated into virtual machines), then the operating system itself will allocate memory more or less optimally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question