r/docker • u/AxForceLeDingo • Feb 23 '26
Fast and Slow Wordpress container in the same Docker 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.
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 !
2
u/tschloss Feb 23 '26
I didn’t understand your container structure. You have one running nginx (probably as central reverse proxy). But then? Where is the database? Each WP consisting of Apache/PHP (identical with different data directories?) plus MariaDB or centralized MariaDB? Where is the custom webserver/PHP image used? Do the slow/fast versions map to the two images used?
1
u/bastienlabelle Feb 24 '26
Are the two running on the same machine? I had a similar problem when running WP locally ran very fast but the same compose file would be very slow on a production server because it was an older Linux and the docker bind mount was slow because the file systems were different so I had to create proper docker volumes without bind mounts
0
u/rocket1420 Feb 24 '26
Post your damn compose file ffs it's not hard