Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alexpgates's avatar

Tuning MySQL on a new Forge server. Do you do it?

I'm curious to know what type of tuning people typically do on a freshly provisioned Forge server. My understanding is that whether you provision a server with 1GB of RAM, 4GB or ram, or 16GB of RAM, Forge leaves MySQL defaults in place.

In my case, I have a 4GB DO server for a WordPress site (~200 MB database).

Do I need to adjust MySQL memory settings / buffer pool stuff / etc.? If so, do you have any recommendations on where to begin?

When I run the mysqltuner.pl script, I see:

[OK] Maximum reached memory usage: 197.3M (4.99% of installed RAM)
[OK] Maximum possible memory usage: 352.4M (8.92% of installed RAM)

Since this is just a staging site (no traffic) it seems likely to me that I'd want to increase the possible memory usage.

perl mysqltuner.pl
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 17h 2m 17s (227K q [3.702 qps], 2K conn, TX: 1G, RX: 1G)
[--] Reads / Writes: 32% / 68%
[--] Binary logging is disabled
[--] Physical Memory     : 3.9G
[--] Max MySQL memory    : 352.4M
[--] Other process memory: 489.1M
[--] Total buffers: 192.0M global + 1.1M per thread (151 max threads)
[--] P_S Max memory usage: 72B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 197.3M (4.99% of installed RAM)
[OK] Maximum possible memory usage: 352.4M (8.92% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/227K)
[OK] Highest usage of available connections: 3% (5/151)
[OK] Aborted connections: 0.11%  (3/2836)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 65K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (63 temp sorts / 8K sorts)
[OK] No joins without indexes
[!!] Temporary tables created on disk: 52% (4K on disk / 8K total)
[OK] Thread cache hit rate: 99% (5 created / 2K connections)
[!!] Table cache hit rate: 9% (382 open / 4K opened)
[OK] Open file limit used: 22% (229/1K)
[OK] Table locks acquired immediately: 99% (97K immediate / 97K locks)
0 likes
1 reply
ejdelmonico's avatar

You could tune mysql server according to recommended tweaks but honestly, I have never had to do it unless the site is suffering from performance issues due to mysql requests. If your site is processing a lot of requests, then maybe a DB server is warranted. You can find plenty of performance information at https://serversforhackers.com/c/mysql-utf8-and-indexing Proper indexing really affects performance on busy mysql servers.

With wordpress, a solid caching plugin will be the best bet.

Please or to participate in this conversation.