Wordpress on Docker container timeout
I'm trying to set up a Wordpress site using Docker, but after a while, my containers stop responding. Here's what I've done already:
- Install Docker and define services
- Install Wordpress and a database
- Install phpMyAdmin
- Using Docker Compose to install the Wordpress site
- Add data to the db via the wordpress rest API
I've checked using docker ps
and the containers are still running. Container logs don't show anything out of the ordinary, but I'm still getting timeouts after a while. CPU, memory, IO all look normal.
What could be the cause of the timeouts? I'm trying to reproduce without success.
2 Replies
It would be helpful to see the exact timeout error you're getting to get a better idea of where the breakdown is occurring. Otherwise, here are a couple links and guides that might give you a couple extra troubleshooting steps to take:
- Linode's guide on installing Wordpress with Docker Compose
- From the Docker forums, a post about increasing daemon timeout options, in case your timeout values needs to be increased
- An article discussing steps to troubleshoot crashing containers
- And from Docker docs, troubleshooting tips
I'd be curious to see what other folks have to say and what the solution ends up being here!
In the browser, it's a standard timeout message 'ERR_CONNECTION_TIMED_OUT'
The problem seem to manifest when I run
docker-compose down
followed bydocker-compose up
When I try to see what containers are running on the node, I do
docker ps
from the terminal. That is I'm able to ssh into the node.
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44c0768ebe5a adminer "entrypoint.sh docke…" 5 minutes ago Up 5 minutes 0.0.0.0:8080->8080/tcp
99fdc2dab4df wordpress "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:80->80/tcp
f0fb4f2df27c mysql:5.7 "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp
If I try with netcat from my computer, I get the following.
% nc -vzw 1 172.105.250.204 80
nc: connectx to 172.105.250.204 port 80 (tcp) failed: Operation timed
out
Same trying netcat on the other containers, port 8080 and 3306.
I've tried running docker system prune, just to see that there's no garbage laying around in the volumes or what not.
I'm running the same docker-compose file locally on my machine, and it's working great.
I've installed docker using apk as per instructions here and here
I've followed the instructions mentioned above to install wordpress in the dockerized environment
I can't see that the containers are crashing per se, they just don't want to respond to external connections. I can connect to them using docker exec -it <container id=""> /bin/sh and interact with them.</container>
If I install iputils-ping in the wordpress container and ping 8.8.8.8 I do get responses, and no packet loss.
If I do traceroute from my machine to the offending node, I get there in about 20 hops.
Pinging the node from my machine yields 0% package loss and about 400ms mean, 10ms stdev roundtrip times.
Checking top inside of the wordpress container shows that the apache service is running
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 236496 34212 27884 S 0.0 1.7 0:00.20 apache2
82 www-data 20 0 236528 8204 1864 S 0.0 0.4 0:00.00 apache2
83 www-data 20 0 236528 8204 1864 S 0.0 0.4 0:00.00 apache2
84 www-data 20 0 236528 8204 1864 S 0.0 0.4 0:00.00 apache2
85 www-data 20 0 236528 8204 1864 S 0.0 0.4 0:00.00 apache2
86 www-data 20 0 236528 8204 1864 S 0.0 0.4 0:00.00 apache2
87 root 20 0 2392 704 632 S 0.0 0.0 0:00.03 sh
420 root 20 0 8056 3172 2732 R 0.0 0.2 0:00.00 top
Any suggestions what to check and what to do would be much appreciated.