From 0b256f0f2f63753229efa8d3e5b5a0809b8340dc Mon Sep 17 00:00:00 2001 From: EarthlingDavey <15802017+EarthlingDavey@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:00:47 +0000 Subject: [PATCH] fpm log slow queries and install `strace` on fpm containers. (#774) --- Dockerfile | 3 +++ deploy/config/php-pool.conf | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 297d54366..1caa351c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,9 @@ ARG version_cron_alpine=3.19.1 FROM ministryofjustice/wordpress-base-fpm:latest AS base-fpm +RUN apk update && \ + apk add strace + # Make the Nginx user available in this container RUN addgroup -g 101 -S nginx; adduser -u 101 -S -D -G nginx nginx diff --git a/deploy/config/php-pool.conf b/deploy/config/php-pool.conf index 10753aaa8..47e3cc3fd 100644 --- a/deploy/config/php-pool.conf +++ b/deploy/config/php-pool.conf @@ -7,8 +7,8 @@ listen.owner = nginx; listen.group = nginx; listen.mode = 0660; -ping.path=/ping -ping.response=pong +ping.path = /ping +ping.response = pong pm = dynamic; pm.start_servers = 10; @@ -18,6 +18,10 @@ pm.max_requests = 500; pm.max_children = 20; pm.status_path = /status; +; Log a stack trace to stderr for slow queries. +request_slowlog_timeout = 10s; +slowlog = /proc/self/fd/2; + [global] daemonize = no emergency_restart_threshold = 10;