Fast and Slow Wordpress Docker in the same stack

Hi Everyone :

I’m creating a test web infrastructure. It contains an Nginx reverse proxy, three WordPress containers, and one Apache + PHP container.

Each web container has its website stored as a bind mount.

When I tried to access the WordPress installation page, I encountered a problem. The page in the first container loads quickly (<1.5 seconds), but the other two containers take >6 seconds.

To try and find the source of the problem, I created a basic .php page in the two slower containers. The PHP page loads instantly. Furthermore, I ran this command on all three containers:

time php -r "file_get_contents('http://127.0.0.1');"

The fast container executed the command in 1 second, while the two slower ones took approximately 6 seconds.

Due to my limited experience, I don’t understand how to resolve this issue. :grinning_face_with_smiling_eyes:

Image used :

  • wordpress:php8.5-apache
  • nginx:1.29.5-alpine
  • custom self-made apache+PHP8.4 image

Thank you in advance to anyone who can help !

If you are using the same Docker image and you bind mount a data folder from the same filesystem, it must be something that the two slower wordpress instances are doing not necessarily related to Docker containers. For example as far as I remember, Worpdress can run some “cron jobs” through PHP when someone sends a request to load a page. If anything like that is happening, you can get slower response.

Have you measured accessing the filesystem in those containers? You should get the same speed in all containers. If not, there is also a difference in the filesystems

On the host with btop, IO of the disk is at 17%.

and in one of the slow container :

root@example:/var/www/html# time ls -l /var/www/html/
total 260
-rw-r–r--  1 root     root       106 Feb 23 10:08 deam.php
-rw-r–r--  1 www-data www-data   405 Feb  6  2020 index.php
-rw-r–r--  1 www-data www-data 19903 Mar  6  2025 license.txt
-rw-r–r--  1 www-data www-data  7425 Jul  8  2025 readme.html
-rw-r–r--  1 root     root       101 Feb 23 10:07 wow.html
-rw-r–r--  1 www-data www-data  7349 Oct  8 03:02 wp-activate.php
drwxr-xr-x  9 www-data www-data  4096 Dec  1 18:02 wp-admin
-rw-r–r--  1 www-data www-data   351 Feb  6  2020 wp-blog-header.php
-rw-r–r--  1 www-data www-data  2323 Jun 14  2023 wp-comments-post.php
-rw-r–r--  1 www-data www-data  5818 Feb  3 03:24 wp-config-docker.php
-rw-r–r--  1 www-data www-data  3339 Aug 12  2025 wp-config-sample.php
-rw-r–r--  1 www-data www-data  5922 Feb 20 11:31 wp-config.php
drwxr-xr-x  4 www-data www-data  4096 Feb 23 10:48 wp-content
-rw-r–r--  1 www-data www-data  5617 Aug  2  2024 wp-cron.php
drwxr-xr-x 31 www-data www-data 16384 Dec  2 18:35 wp-includes
-rw-r–r--  1 www-data www-data  2493 Apr 30  2025 wp-links-opml.php
-rw-r–r--  1 www-data www-data  3937 Mar 11  2024 wp-load.php
-rw-r–r--  1 www-data www-data 51437 Oct 29 10:37 wp-login.php
-rw-r–r--  1 www-data www-data  8727 Apr  2  2025 wp-mail.php
-rw-r–r--  1 www-data www-data 31055 Nov  7 12:42 wp-settings.php
-rw-r–r--  1 www-data www-data 34516 Mar 10  2025 wp-signup.php
-rw-r–r--  1 www-data www-data  5214 Aug 19  2025 wp-trackback.php
-rw-r–r--  1 www-data www-data  3205 Nov  8  2024 xmlrpc.php

real    0m0.005s
user    0m0.000s
sys     0m0.005s

The fast container takes exactly the same time

I just downloaded the entire stack to my Windows desktop Docker and I’m not experiencing any slowdowns. I could try resetting my Debian 13 instance.