www.conf
/etc/php/[version]/fpm/pool.d/www.conf
ini pm = dynamic pm.max_children = 50 pm.start_servers = 10 pm.min_spare_servers = 5 pm.max_spare_servers = 20
php.ini
ini opcache.enable=1 opcache.memory_consumption=256 opcache.max_accelerated_files=20000 opcache.validate_timestamps=0
bash sudo systemctl restart php[version]-fpm nginx
my.cnf
ini slow_query_log = 1 slow_query_log_file = /var/log/mysql/mysql-slow.log long_query_time = 1
EXPLAIN
type: ALL
sql ALTER TABLE wp_postmeta ADD INDEX meta_key_value_index (meta_key(191), post_id);
bash sudo apt update && sudo apt install redis-server php-redis
wp-config.php
php define( 'WP_REDIS_HOST', '127.0.0.1' ); define( 'WP_REDIS_PORT', 6379 ); define( 'WP_CACHE_KEY_SALT', 'your_domain_' );
redis-cli monitor
redis-cli info stats
Cache-Control: no-cache
Set-Cookie
bash curl -I [https://yourdomain.com](https://yourdomain.com)
nginx location ~* \.(jpg|jpeg|png|gif|ico|css|js|webp|avif)$ { expires 1y; add_header Cache-Control "public, no-transform, immutable"; }
nginx.conf
http
nginx brotli on; brotli_comp_level 6; brotli_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
nginx gzip on; gzip_vary on; gzip_min_length 1024; gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
content-encoding: br
gzip
cwebp
bash cwebp -q 80 input.jpg -o output.webp
html <img src="image.webp" loading="lazy" alt="Optimized Asset" width="800" height="600">
width
height
html <script src="[https://example.com/widget.js](https://example.com/widget.js)" defer></script>
<head>
<style>
html <link rel="preload" href="styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
Ctrl + Shift + P
php function remove_unnecessary_scripts() { if ( ! is_page('contact') ) { wp_dequeue_script( 'heavy-contact-form-script' ); } } add_action( 'wp_enqueue_scripts', 'remove_unnecessary_scripts', 100 );
bash htop
max_connections
ini max_connections = 300 thread_cache_size = 50
ini innodb_buffer_pool_size = 4G
bash sudo systemctl restart mysql
nginx worker_processes auto; events { worker_connections 2048; use epoll; multi_accept on; }
nginx keepalive_timeout 65; keepalive_requests 100; client_header_timeout 10; client_body_timeout 10;
bash sudo nginx -t && sudo systemctl reload nginx
Get new diagnostic & troubleshooting guides directly in your inbox.
Copy and paste this snippet into your HTML to embed this interactive diagnostic troubleshooter on your site.