0

I host about 60 client sites on this server: AMD EPYC 7401P 24 Cores "Naples" (Zen) 128GB DDR4 ECC RAM NVMe storage. Centos7

All sites are PrestaShop 1.7 sites with each their own PHP 7.1 PHP-FPM pool as well as one MySQL (MariaDB) database for each site.

The speed is good, but I am considering to migrate to one separate MySQL server and one web-server.

I have NO IDEA how much resources MySQL uses vs Apache and PHP-FPM.

Let's say I keep Apache and PHP-FPM on my current server and buy a new server for MySQL. What server should I get? Half the RAM and CPU compared to the webserver? Double, same?

My guess is that the answer is: it's hard to say without real data, so a followup would then be: how can I get this data, preferably resource usage over time? Is this data hidden in the system allready or do I need to install some statistics tool?

OnklMaps
  • 113
  • 4

1 Answers1

0

(I don't know about PrestaShop, I will address generic scaling with MySQL.)

Yes, moving the database to a separate server is a reasonable first-step in scaling your application.

  • How much data do you have (or will you have)? RAM size is a tradeoff between having enough to cache most or all the data versus the cost of RAM.
  • CPU (for MySQL) does not matter. Almost always, excess CPU usage can be solved by improving indexing and/or queries.
  • Disk speed may be important.
  • MySQL wants to use RAM and Disk. Apache and PHP want to use CPU. So you may not see much improvement.
  • If you can identify that Apache/PHP/PrestaShop is the hog, you can have multiple servers running that, then have one MySQL server.
  • If MySQL is the hog, let's see the slow queries. If things can be solved, then Replication is likely to be the solution.

As for investigating/improving the current (single-server) setup:

  • If the clients come and go, don't configure for a full 60 connections.
  • MySQL desires 70% of available RAM and hates when swapping occurs. "Available" means after accounting for OS, code, other apps.
  • Windows? or Unix? Let's see the top part of top when sorted by memory. And by CPU. (During a busy time)
Rick James
  • 2,058
  • 5
  • 11