Drupal Performance
From Wasya Wiki
Add these to settings.php:
$settings['cache']['bins']['render'] = 'cache.backend.database' $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.database' $settings['cache']['bins']['page'] = 'cache.backend.database'
reconfigure /etc/mysql/conf.d/docker.conf
[mysqld] # skip-host-cache # skip-name-resolve max_connections = 300
part IV
See how long the request takes:
curl -o /dev/null -s \
-w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer} total=%{time_total}\n' \
https://piousbox.com/issues/2025q2-issue
Add nginx log temporarily:
log_format timing '$remote_addr - $request '
'rt=$request_time '
'urt=$upstream_response_time '
'uht=$upstream_header_time '
'uct=$upstream_connect_time';
#
access_log /var/log/nginx/timing.log timing;
Interpretation:
- high request_time + high upstream_*
- → backend app is slow
- high request_time + no upstream times
- → nginx/static filesystem issue
- high upstream_connect_time
- → nginx struggling to reach upstream
- high upstream_header_time
- → app slow before first byte