On standard cPanel & WHM installations, all core hosting subsystems—Apache/LiteSpeed web servers, PHP-FPM workers, Exim mail transport, Dovecot IMAP, ClamAV antivirus, and the MariaDB/MySQL relational database—fight for CPU and memory on the exact same operating system instance.
For modest websites, this monolithic setup is convenient. But as your traffic expands, this shared architecture creates a lethal performance deadlock:
- Memory Starvation: MariaDB’s
innodb_buffer_pool_sizeshould ideally claim 60%–70% of available physical RAM. On a monolithic host, reserving that memory starves PHP-FPM, forcing the kernel into swapping. - I/O Head Contention: Web server access logging, incoming email spools, and heavy database read/write queries compete for disk queue depth, causing massive I/O wait (
%iowait) spikes. - CPU Throttling: Complex SQL joins and unindexed table scans spike CPU cores, causing web requests to hang and triggering
504 Gateway Timeouterrors across all hosted client sites.
The solution is the Two-Tier Architecture: decoupling the database engine onto an isolated, high-memory bare-metal database server.
In this guide, we walk through configuring a dedicated Remote MySQL server in cPanel & WHM, securing it over private network interfaces, and eliminating database latency in Pakistani datacenter environments.
The Architecture: Monolithic vs. Decoupled cPanel
MONOLITHIC HOST (Single Point of Failure)
┌────────────────────────────────────────────────────────┐
│ Single cPanel Server │
│ ├─ NGINX / LiteSpeed Web Traffic │
│ ├─ 150x PHP-FPM Application Workers │
│ └─ MariaDB 10.11 (Fighting for RAM & NVMe Disk I/O) │
└────────────────────────────────────────────────────────┘
TWO-TIER DECOUPLED ARCHITECTURE (High Concurrency)
┌────────────────────────┐ Private 10GbE Network ┌────────────────────────┐
│ cPanel Web Node │ (Sub-0.2ms Datacenter Fabric) │ Dedicated MariaDB Node │
│ ├─ Pure Web Workers │ ─────────────────────────────► │ ├─ 128GB Buffer Pool │
│ ├─ Fast Page Caching │ ◄───────────────────────────── │ ├─ Hardware RAID10 NVMe│
│ └─ Zero Local Database │ │ └─ Dedicated CPU Cores │
└────────────────────────┘ └────────────────────────┘
By offloading the database, your web server can dedicate 100% of its memory and CPU to processing web traffic and SSL termination, while your database server runs uninhibited in memory.
For production database nodes, bare-metal hardware is mandatory to avoid shared hypervisor I/O throttling. Review our high-RAM configurations on Dedicated Servers and local private rack interconnects on Dedicated Servers in Pakistan.
Step 1: Preparing the Dedicated Remote MariaDB Server
Deploy an enterprise Linux server (AlmaLinux 9 or Rocky Linux 9) connected to the same local datacenter private VLAN as your cPanel web server.
1. Install MariaDB 10.11 Enterprise
dnf install mariadb-server mariadb -y
systemctl enable --now mariadb
2. Configure Private Network Binding
In /etc/my.cnf.d/server.cnf, ensure MariaDB binds to its private network IP address (10.0.10.25), never exposed to the public internet:
[mysqld]
# Bind strictly to private interface
bind-address = 10.0.10.25
port = 3306
# Allocate 70% of Dedicated RAM to Buffer Pool
innodb_buffer_pool_size = 96G
innodb_buffer_pool_instances = 16
innodb_log_file_size = 4G
innodb_flush_log_at_trx_commit = 2
innodb_io_capacity = 15000
innodb_io_capacity_max = 30000
# High Concurrency Connections
max_connections = 2500
table_open_cache = 16000
thread_cache_size = 256
wait_timeout = 60
interactive_timeout = 60
# Disable DNS reverse lookup for 30% faster remote handshakes
skip-name-resolve
Restart MariaDB to apply changes:
systemctl restart mariadb
Step 2: Granting WHM Cluster Management Privileges
On the remote database server, create a privileged user that allows your cPanel WHM server (10.0.10.10) to create users, provision databases, and assign grants automatically:
-- Log in as root on the Remote DB Server
mysql -u root
-- Create WHM management administrator
CREATE USER 'cpanel_mgr'@'10.0.10.10' IDENTIFIED BY 'StrongRandomVaultPassword#2026';
GRANT ALL PRIVILEGES ON *.* TO 'cpanel_mgr'@'10.0.10.10' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Step 3: Configuring the Remote Database Server in WHM
Now, connect your cPanel node to the remote database machine:
- Log into your primary cPanel server’s WHM (
https://yourserver.pk:2087). - In the search box, navigate to Home » SQL Services » Manage MySQL Profiles.
- Click Create a new profile.
- Configure the profile:
- Profile Name:
Dedicated-MariaDB-Cluster - Database Host:
10.0.10.25(Private Network IP) - Database Port:
3306 - Admin Username:
cpanel_mgr - Admin Password:
StrongRandomVaultPassword#2026
- Profile Name:
- Click Validate and Activate.
WHM will connect to the remote server over the private network, verify privileges, and automatically designate it as the default database engine for all existing and newly created cPanel accounts.
Step 4: Migrating Existing Databases to the Remote Node
To migrate all current cPanel user databases to the newly provisioned remote server without manual database dumps, execute the official cPanel automated migration script:
# On the cPanel web node:
/usr/local/cpanel/scripts/migrate_all_databases_to_remote_server --profile=Dedicated-MariaDB-Cluster
The script will:
- Sequentially dump each user’s MySQL databases.
- Stream and import the schemas into the remote MariaDB node.
- Automatically update
user@hostpermissions to allow connections from the cPanel web server IP. - Verify checksums to ensure zero data corruption.
Network Latency Optimization in Pakistani Datacenters
When decoupling web and database layers, network latency is the critical metric. Every unbuffered SQL query incurs a network round-trip.
- Acceptable Private Network Latency: $< 0.3\text{ ms}$ (within the same datacenter rack or switch).
- Unacceptable Latency: $> 2.0\text{ ms}$ (connecting over the public internet or across different cities).
Always verify network round-trip times using ping and traceroute over the private interface:
ping -c 20 10.0.10.25
Output should show:
rtt min/avg/max/mdev = 0.112/0.145/0.188/0.021 ms
Performance Note: By enabling
skip-name-resolveon the remote MySQL instance, you prevent the database from querying DNS resolvers on every single incoming connection from the web server, slashing connection establishment time from 15ms down to microseconds.
Supercharge Your cPanel Performance with Dedicated MariaDB
Eliminate database bottlenecks, reduce I/O wait times to zero, and unlock massive concurrency for your client applications with private-network dedicated database clusters.
