Series: WordPress Performance on DirectAdmin (Rocky Linux 9)
Phase 1: Foundations — Part 4 of 30
Why Compare DirectAdmin and cPanel for WordPress Performance?
This series assumes you are already running WordPress on DirectAdmin with Rocky Linux 9 (EL9). Many sysadmins come from cPanel and want to understand what changes in terms of performance tuning, especially around PHP-FPM, NGINX/Apache, and per-domain control.
Both panels can deliver fast WordPress sites. The difference is how much control you get, how cleanly they integrate PHP-FPM and NGINX, and how easy it is to apply consistent performance patterns across many WordPress instances.
This article focuses on:
- Where DirectAdmin and cPanel differ for WordPress performance
- How DirectAdmin’s model on Rocky Linux 9 impacts tuning
- Practical DirectAdmin-first recommendations, with references to cPanel equivalents
Architecture Overview: DirectAdmin vs cPanel
DirectAdmin on Rocky Linux 9
On a typical DirectAdmin + Rocky Linux 9 stack (current custombuild defaults):
- Web: Apache, NGINX, or NGINX as reverse proxy to Apache (most common)
- PHP: PHP-FPM, usually per-user pools, sometimes per-domain pools
- Service control:
systemdunits likephp-fpm80.service,nginx.service,httpd.service - Config templates: DirectAdmin custom templates for NGINX/Apache vhosts and PHP-FPM pools
DirectAdmin tends to be less opinionated than cPanel, which is good for performance work: fewer layers, more direct access to configs, and easier to standardize across domains via templates.
cPanel (for comparison)
On cPanel (CloudLinux/Alma/Rocky-like):
- Web: Usually Apache with EA4, optional NGINX or LiteSpeed
- PHP: PHP-FPM or
lsphp, with WHM managing pool configs - Strong integration with EasyApache and WHM UI, but more locked-in config paths
cPanel provides more guardrails but makes deep, panel-wide performance changes harder without fighting the tooling. DirectAdmin leaves more room for tailored tuning, which is what we leverage in this series.
PHP-FPM: DirectAdmin Strength vs cPanel
DirectAdmin PHP-FPM Pool Model
DirectAdmin typically runs PHP-FPM with per-user pools. You can also configure per-domain pools via custom templates, which is often preferable for high-traffic WordPress sites.
On Rocky Linux 9, PHP-FPM configs for DirectAdmin are usually under:
/usr/local/php80/etc/php-fpm.d/(path varies by PHP version and custombuild)- DirectAdmin templates:
/usr/local/directadmin/data/templates/php-fpm
Key performance levers per pool:
pm(dynamic vs ondemand)pm.max_childrenpm.start_servers,pm.min_spare_servers,pm.max_spare_serverspm.max_requests
Compared to cPanel, DirectAdmin makes it easier to define different pool characteristics per domain or per user via templates, without fighting a heavy UI abstraction.
Good Starting Values for WordPress Pools
Assume a mid-range Rocky Linux 9 VPS:
- 4 vCPUs
- 8 GB RAM
- 5–10 small/medium WordPress sites
A solid starting point for a typical WordPress domain pool:
[example_com]
user = example
group = example
listen = /usr/local/php80/sockets/example_com.sock
pm = ondemand
pm.max_children = 10
pm.process_idle_timeout = 20s
pm.max_requests = 500
request_terminate_timeout = 120s
php_admin_value[memory_limit] = 256M
php_admin_value[upload_max_filesize] = 64M
php_admin_value[post_max_size] = 64M
On cPanel, equivalent tuning is possible, but pool configs are often regenerated by WHM, and per-domain customization is less template-driven.
Editing PHP-FPM Templates in DirectAdmin
Warning: Misconfigured PHP-FPM templates can cause downtime for all PHP sites. Apply changes in a staging environment first.
To make template-based changes that survive rebuilds:
- Copy default templates to custom:
sudo mkdir -p /usr/local/directadmin/data/templates/custom
sudo cp /usr/local/directadmin/data/templates/php-fpm* \
/usr/local/directadmin/data/templates/custom/
- Edit the user/domain PHP-FPM template, for example:
sudo vi /usr/local/directadmin/data/templates/custom/php-fpm.conf
- Apply changes using custombuild:
cd /usr/local/directadmin/custombuild
sudo ./build php_fpm
sudo systemctl reload php-fpm80
DirectAdmin will now use your adjusted template for future pool configs. This is more predictable than cPanel’s sometimes opaque regeneration behavior.
Testing PHP-FPM Changes
- Check for syntax errors:
sudo php-fpm80 -t
- Reload PHP-FPM:
sudo systemctl reload php-fpm80
- Tail logs for errors:
sudo tail -f /var/log/php-fpm/error.log
NGINX/Apache: DirectAdmin Templates vs cPanel EA4
DirectAdmin NGINX/Apache Stack
On DirectAdmin, the common high-performance pattern is:
- NGINX: static assets, caching, reverse proxy
- Apache: PHP backend via PHP-FPM
Config locations on Rocky Linux 9 typically include:
- NGINX:
/etc/nginx/nginx.conf, per-domain under/etc/nginx/conf.d/or DirectAdmin-managed paths - Apache:
/etc/httpd/conf/httpd.conf, vhosts under/etc/httpd/conf/extra/httpd-vhosts.confor DirectAdmin-managed equivalents - DirectAdmin templates:
/usr/local/directadmin/data/templates/
Compared to cPanel’s EasyApache 4 (EA4), DirectAdmin gives you more direct control over NGINX and Apache configs via templates, without as many panel-level constraints.
Per-Domain NGINX Tuning for WordPress
Warning: NGINX syntax errors will bring down all sites served by NGINX. Always test configs before reload.
For a WordPress domain, you want:
- Proper
try_filesfor permalinks - Caching of static assets
- Optional micro-cache for anonymous traffic (advanced)
Example per-domain snippet (conceptually; adapt to DirectAdmin’s vhost template structure):
server {
server_name example.com www.example.com;
root /home/example/domains/example.com/public_html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/usr/local/php80/sockets/example_com.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
location ~* \.(css|js|jpg|jpeg|png|gif|svg|ico|webp)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
}
}
To make this persistent in DirectAdmin, customize the NGINX templates:
- Copy NGINX templates to custom:
sudo mkdir -p /usr/local/directadmin/data/templates/custom
sudo cp /usr/local/directadmin/data/templates/nginx* \
/usr/local/directadmin/data/templates/custom/
- Edit the domain-level template, for example:
sudo vi /usr/local/directadmin/data/templates/custom/nginx_server.conf
- Rebuild NGINX configs and reload:
cd /usr/local/directadmin/custombuild
sudo ./build nginx
sudo nginx -t
sudo systemctl reload nginx
cPanel’s EA4 lets you add include files per vhost, but you often have to work around WHM defaults. DirectAdmin’s template system is simpler and more predictable for performance tuning.
Per-Domain Tuning: DirectAdmin Advantage
DirectAdmin’s per-domain structure on Rocky Linux 9 makes it straightforward to isolate and tune heavy WordPress sites independently.
Checklist: When to Create a Dedicated PHP-FPM Pool per Domain
- Domain has > 50k pageviews/day
- Frequent WooCommerce or membership traffic
- Background tasks (WP-Cron, queues) running often
- PHP memory usage spikes above 256M per process
In those cases, switch from per-user to per-domain pool and adjust pm.max_children upward only for that domain, instead of globally. DirectAdmin templates make this easy; cPanel often requires WHM-level changes impacting many accounts.
Per-Domain Apache Settings
For Apache (when used behind NGINX), focus on:
- KeepAlive and MPM (usually
eventon EL9) - Per-vhost overrides (
AllowOverride)
On Rocky Linux 9, verify MPM and key settings:
sudo httpd -M | grep mpm
sudo grep -E "KeepAlive|MaxRequestWorkers" /etc/httpd/conf/httpd.conf
DirectAdmin does not hide these behind a heavy UI, so you can tune them directly and then adjust templates if you want them standardized.
Testing Performance: DirectAdmin-Centric Workflow
1. Warm-Up and Basic HTTP Checks
Use curl to validate NGINX/Apache/PHP-FPM after changes:
curl -I https://example.com/
curl -s -o /dev/null -w "%{http_code} %{time_total}
" https://example.com/
2. WP-CLI for Application-Level Checks
On DirectAdmin, WordPress installs are usually under:
/home/USER/domains/DOMAIN/public_html
Run WP-CLI as the domain user:
sudo -u example -i
cd /home/example/domains/example.com/public_html
wp core version
wp plugin status
wp option get home
exit
Use WP-CLI to disable heavy plugins temporarily when testing performance:
sudo -u example -i
cd /home/example/domains/example.com/public_html
wp plugin deactivate some-heavy-plugin
exit
3. Load Testing with wrk or k6
Warning: Load testing against production can cause real downtime. Prefer staging or off-peak windows and throttle concurrency.
Install tools on Rocky Linux 9:
sudo dnf install -y epel-release
sudo dnf install -y wrk
Basic wrk example:
wrk -t4 -c40 -d60s https://example.com/
For k6 (if you prefer it), use the official RPM or binary from Grafana Labs. Then run a simple script to simulate real users hitting a key page.
4. Log Tailing During Tests
Monitor NGINX, Apache, and PHP-FPM logs in parallel:
sudo tail -f /var/log/nginx/access.log /var/log/nginx/error.log
sudo tail -f /var/log/httpd/access_log /var/log/httpd/error_log
sudo tail -f /var/log/php-fpm/error.log
Look for:
502/504errors (upstream or timeout issues)- PHP-FPM
server reached pm.max_childrenmessages - Slow responses clustered around specific URLs or plugins
Rocky Linux 9 System-Level Considerations
Service Management
DirectAdmin integrates cleanly with systemd on Rocky Linux 9. You control services with:
sudo systemctl status nginx
sudo systemctl status httpd
sudo systemctl status php-fpm80
Reload vs restart:
reload: Apply config changes without dropping connections (preferred when possible).restart: Full stop/start; can cause brief downtime.
Firewall (firewalld)
Ensure HTTP/HTTPS are open:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
This is panel-agnostic but essential for any performance testing that involves external clients.
DirectAdmin vs cPanel: Practical Performance Summary
Where DirectAdmin Has an Edge
- Template-driven configs: Easier to standardize NGINX/Apache/PHP-FPM performance patterns across domains.
- Per-domain PHP-FPM control: Straightforward to assign dedicated pools and tune
pm.*for heavy WordPress sites. - Lighter stack: Less overhead and fewer abstraction layers than WHM/EasyApache, which is useful on smaller Rocky Linux 9 VPSes.
Where cPanel Can Be Simpler
- UI-driven changes: Less shell work for basic tuning (at the cost of flexibility).
- More presets: WHM exposes some performance levers directly, which can help teams uncomfortable with editing configs.
If your team is comfortable with shell and config management, DirectAdmin on Rocky Linux 9 provides a cleaner foundation for serious WordPress performance tuning.
DirectAdmin WordPress Performance Checklist (vs cPanel Mindset)
Use this as a quick reference when migrating from cPanel or standardizing DirectAdmin hosts.
Initial Host Setup
- Confirm NGINX + Apache + PHP-FPM stack via DirectAdmin custombuild.
- Verify
eventMPM and reasonable Apache limits. - Open HTTP/HTTPS in
firewalld.
Per-Domain WordPress Tuning
- Ensure proper NGINX
try_filesfor permalinks. - Set static asset caching headers in NGINX templates.
- Use per-domain PHP-FPM pools for busy sites; tune
pm,pm.max_children,pm.max_requests. - Use WP-CLI to disable known heavy plugins when benchmarking.
Testing and Iteration
- After any template change, run
nginx -torphp-fpm80 -tbefore reload. - Use
curlfor quick response time checks. - Use
wrkor k6 for controlled load tests (prefer staging). - Tail NGINX, Apache, and PHP-FPM logs during tests.
This article offers general technical guidance. Validate all configurations in a safe environment before applying them to production.
Previous: Common WordPress Performance Mistakes on VPS Hosting
Next: How to Configure PHP 8.3 for Maximum WordPress Performance on DirectAdmin


Leave a Reply