Report this

What is the reason for this report?

MariaDB - How do I reduce RAM usage (Hosting WordPress Websites)

Posted on July 27, 2020

Hi,

We recently setup droplet with cPanel & WHM, on CentOS (Upgraded to CloudLinux) and installed MariaDB, Redis, LiteSpeed Cache, Imunify360, Railgun and a few other things.

We only host WordPress websites and most of them have WP Cron disabled, I don’t understand why they are using so much memory…

If I look in mysqladmin status it shows:

Uptime: 577820 Threads: 22 Questions: 2372265 Slow queries: 0 Opens: 11109 Flush tables: 1 Open tables: 2000 Queries per second avg: 4.105

If I look in mysqladmin processlist it shows:

| Id     | User        | Host      | db                 | Command | Time | State                    | Info             | Progress |
+--------+-------------+-----------+--------------------+---------+------+--------------------------+------------------+----------+
| 1      | system user |           |                    | Daemon  |      | InnoDB purge worker      |                  | 0.000    |
| 2      | system user |           |                    | Daemon  |      | InnoDB purge coordinator |                  | 0.000    |
| 3      | system user |           |                    | Daemon  |      | InnoDB purge worker      |                  | 0.000    |
| 4      | system user |           |                    | Daemon  |      | InnoDB purge worker      |                  | 0.000    |
| 5      | system user |           |                    | Daemon  |      | InnoDB shutdown handler  |                  | 0.000    |
| 9      | root        | localhost | information_schema | Sleep   | 15   |                          |                  | 0.000    |
| 139018 | root        | localhost |                    | Query   | 0    | Init                     | show processlist | 0.000    |
+--------+-------------+-----------+--------------------+---------+------+--------------------------+------------------+----------+

We have 1GB of swap & 2GB of RAM at the moment. If I check htop and sort by memory first you see the following:

https://i.imgur.com/pjAzVX3.png

We already disabled XML-RPC so it shouldn’t be that.

My my.cfg file located in /etc/my.cnf looks like:

[mysqld]
performance-schema = 0
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
symbolic-links = 0
log-error = /var/log/mysqld.log
innodb_file_per_table = 1
max_allowed_packet = 268435456
open_files_limit = 40000
innodb_buffer_pool_size = 54525952

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.