Hello,
On Sun, Nov 26, 2023 at 12:13:40AM +0000, Andy Smith via BitFolk Users wrote:
I'd likely run one MariaDB on the main VM.
The other thing I'd probably do is run one reverse proxy (e.g.
haproxy) in one container to put in front of all the others so that
it can cache resources for all of them in one place. Otherwise
you've got N copies of Apache (or whatever) each trying to reserve a
bit of memory to cache the resources it is responsible for serving.
It may also be desirable to have the proxy terminate the TLS so that
all happens in one place, too.
But I would not spend any time on that until I'd worked out how to
not run a new copy of MariaDB with every Wordpress site. The whole
thing with a DBMS is that it manages its own chunk of memory and
storage so by running multiple of them it's wasting a lot of
resources and busting your caches when likely the total query load
is small. Just look at all the settings MariaDB has for buffer sizes
- all of those are being multiplied by the number of sites you're
trying to run.
Another thing you might want to think about with Docker is that any
time you need to upgrade the Docker packages it's going to tear
down ALL of your containers to do it. Are you prepared for that
downtime?
Currently the only thing I run in Docker is mastodon but I've seen
MANY package updates to the docker packages on Debian 12 so far, and
each time that happens my mastodon server goes down until Docker has
had chance to restart. I don't care, but I'm the only user.
When you run Wordpress sites conventionally outside of Docker, sure
there might be upgrades to Apache or to MariaDB, but those are
relatively quick and sometimes can take advantage of graceful
reloads so that people may not even notice. Having Docker restart
all containers can take a few seconds. Especially with the way you
have it now - MariaDB is not fast to start!
That's why people who make non-trivial use of containers tend to
want to put them in some sort of orchestration system (e.g Docker
Swarm, k8s, …) across multiple hosts so that they can ensure that
there is a staggered restart. Lots more complexity.
Thanks,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting