Series: WordPress Performance on DirectAdmin (Rocky Linux 9)
Phase 7: Themes, Gutenberg & Measurement — Part 27 of 30
Optimising Gutenberg for Faster WordPress Admin Experience
WordPress’s Gutenberg editor, while powerful, can introduce noticeable latency in the admin interface, especially for large or heavily customised sites. Sysadmins managing WordPress on DirectAdmin (Rocky Linux 9) should address both backend server configuration and frontend asset optimisation to deliver a more responsive editing experience. This guide outlines DirectAdmin-specific techniques, safe PHP-FPM tuning, and practical ways to measure and validate improvements.
Understanding Gutenberg’s Performance Bottlenecks
Gutenberg is JavaScript-heavy and depends on REST API endpoints, PHP execution, and database queries. Delays can stem from:
- Poor PHP-FPM configuration (insufficient workers, slow process recycling)
- Unoptimised NGINX/Apache DirectAdmin templates
- Large REST API payloads or slow plugin/theme functions
- Uncached admin-ajax.php and REST requests
- Unminified or unoptimised editor assets
Step 1: Audit Current Performance
1.1. Benchmark Gutenberg Responsiveness
- Use browser dev tools to record TTFB (Time To First Byte) on editor loads and REST API calls (e.g.,
/wp-json/wp/v2/posts). - From your server, measure REST API speed:
curl -s -o /dev/null -w '%{time_total}
' 'https://yourdomain/wp-json/wp/v2/posts'
- For repeatable load tests, use
wrkork6on key endpoints.
1.2. Monitor Server Load and PHP-FPM Pool Usage
sudo systemctl status php82-php-fpm
sudo tail -f /var/log/php-fpm/www-error.log
sudo tail -f /var/log/nginx/access_log # or apache access_log as relevant
- Check
toporhtopfor PHP-FPM worker usage during editing.
Step 2: Optimise PHP-FPM Pools for Admin Responsiveness
DirectAdmin manages per-domain PHP-FPM pools. Admin-heavy sites or those with many editors may outgrow default settings. Editing in Gutenberg triggers bursts of REST/POST requests, which are resource-intensive.
2.1. Locate and Edit PHP-FPM Pool Config
- Pool configs are found at
/usr/local/directadmin/data/users/<user>/php/php-fpm80.conf(adjust version as needed). - For custom changes across all sites, edit DirectAdmin templates:
/usr/local/directadmin/data/templates/php-fpm81.conf
Safe Starting Values (per busy site):
pm = dynamic
pm.max_children = 8
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.max_requests = 500
request_terminate_timeout = 60s
Increase pm.max_children if you have more concurrent editors or see 502 errors under load. After changes:
sudo systemctl reload php82-php-fpm
- Warning: Editing global templates requires rebuilding configs and reloading PHP-FPM. Test on staging first.
Step 3: Fine-Tune NGINX/Apache for REST Performance
DirectAdmin allows per-domain NGINX or Apache template overrides. Focus on:
- Removing unnecessary rate limits on
/wp-json/and/wp-admin/ - Ensuring REST and AJAX endpoints aren’t cached (to avoid inconsistent admin experience)
3.1. Example NGINX Snippet for DirectAdmin
location ~ ^/(wp-json|wp-admin|wp-login\.php) {
proxy_pass http://unix:/var/run/php-fpm/domain.sock;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Disable caching
add_header Cache-Control "private, no-store";
}
Update your nginx_php.conf template in /usr/local/directadmin/data/templates/custom/ and rebuild configs:
cd /usr/local/directadmin/custombuild
sudo ./build rewrite_confs
Test with:
curl -I https://yourdomain/wp-json/wp/v2/posts
Step 4: Prune Unused Editor Assets and Plugins
Every Gutenberg block registered by plugins can slow down the editor. Removing unused plugins and block libraries lightens the REST payload and reduces JS/CSS bloat.
4.1. List and Deactivate Unused Plugins via WP-CLI
wp plugin list --status=active
wp plugin deactivate plugin-slug
- For multisite, add
--networkas necessary.
4.2. Remove Unused Block Patterns and Styles
wp option update core_block_patterns false
- Add filter in a mu-plugin to disable default block styles if not required.
// mu-plugins/disable-block-styles.php
<?php
add_action('wp_enqueue_scripts', function() {
wp_dequeue_style('wp-block-library');
}, 100);
Step 5: Optimise Database for REST API Speed
- Large
wp_postsandwp_postmetatables can slow down Gutenberg’s REST queries. - Run the following to identify overhead:
sudo dnf install -y mysqltuner
mysqltuner
- Clean up post revisions and orphaned meta:
wp post delete $(wp post list --post_type='revision' --format=ids)
wp db query "DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT ID FROM wp_posts);"
Always back up your database before running destructive operations.
Step 6: Defer or Disable Non-Essential Admin Scripts
Many plugins load scripts site-wide, including in the editor. Use WP_DISABLE_ADMIN_SCRIPTS constant or mu-plugins to restrict script loading to only necessary pages.
// mu-plugins/strip-admin-scripts.php
<?php
add_action('admin_enqueue_scripts', function() {
// Example: Remove plugin script from editor
wp_dequeue_script('plugin-handle');
}, 100);
Step 7: Continual Measurement and Validation
- After each optimisation, repeat curl/wrk/k6 REST API tests.
- Ask editors for subjective feedback (“is the editor more responsive?”).
- Monitor
php-fpmpool stats (pm.status_path) and logs:
sudo tail -f /var/log/php-fpm/www-slow.log
sudo tail -f /var/log/nginx/error_log
Quick Reference Checklist
- Audit REST API/editor load time with curl & browser tools.
- Increase
pm.max_childrenand tune PHP-FPM for each busy site. - Tweak NGINX/Apache DirectAdmin templates for optimal REST handling.
- Remove unused plugins/blocks; prune heavy editor scripts via WP-CLI/mu-plugins.
- Optimise database tables; regularly clean post revisions/meta.
- Measure, monitor, and iterate on every change—prefer staged rollout.
Note: This article offers general technical guidance. Validate all configurations in a safe environment before applying them to production.
Conclusion
For sysadmins on DirectAdmin (Rocky Linux 9), a fast Gutenberg experience requires both application-layer and server-layer tuning. Focus on PHP-FPM pool sizing, NGINX/Apache REST handling, plugin bloat, and proactive measurement. By following these phased steps, you can deliver a noticeably faster, more reliable admin interface for editors and content teams while maintaining stable, reproducible server operations.
Previous: Theme Twenty Twenty-Five Performance: A Real-World Analysis
Next: How to Measure Real WordPress Performance (Not PageSpeed Scores)

