Answer the question
In order to leave comments, you need to log in
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
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.
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)
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question