Memory issues on WP and DB containers #59
Replies: 1 comment
-
Hello @mtibbits140 That's a very good discussion and I have faced the same issue. I normally reserve at least 500Mb for each WordPress, and in fact the CPU will probably never be a problem if you run only WordPress or similar applications. I also limit the resources and it only increase usage if the site starts to get really larger in files, cache, pictures or even transactions. The limits on the logs are also something I have integrated into wordpress containers. Other option would be to create one database for all wordpress instances and make sure it uses different databases name and users, so a user could not access another database. But this is something I still haven't done yet... Let's see if someone has any other suggestion on that. P.S.: You could try the docker-compose version 3 as of link below: https://docs.docker.com/compose/compose-file/deploy/#resources |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I am using your letsencrypt-nginx-proxy-companion along with a very similar configuration for my WordPress and database containers. We are using this in a production environment. Our VPS has 16GB of RAM and right now 40 sites are consuming 95% of that memory. If I run
docker stats
I notice that a lot of containers continue to use more and more memory over time.If I use version 2 of the docker-compose.yml file then I can set memory limits and/or memory reservations. However, once the container reaches the memory limit set I start getting "502 Bad Gateway" errors.
I was wondering if you have any suggestions for imposing a limit on how much memory a WordPress or database docker container can use? We are barely using 5% of our CPU resources so the goal is to be able to put more sites on this particular VPS (without increasing the amount of memory).
Thank you,
Matt
Beta Was this translation helpful? Give feedback.
All reactions