Bikers back with I have a project that wants to host six to 10 very very lightweight sorry six to 10 1
very very lightweight Web sites. 2
I could make a container for each but could also edit Apache config to multi host out of one container 3
are the tradeoffs. 4
All right. 5
So this is a great question. 6
Biker 2010 what you're asking is Apache servers because we've had Apache for decades and decades. 7
Apache Web servers have the ability to run many Web sites all in one daemon. 8
Right. 9
So one Apache HPD could run many different Web sites that are unrelated. 10
And should you do that vs. many containers so maybe one Web site per container or one large container 11
image that has all the Web sites. 12
Me my preference. 13
If I'm running containers especially if I'm running a orchestrator like swarm or Kubernetes is always 14
more containers. 15
The reason is is that Apache Apache obviously has that capability but that better capability was built 16
into Apache decades ago way before we had containers and isolation. 17
And if I can isolate my web sites into different containers. 18
Now in theory that means we are running more Apache demons and that's a little bit less efficient. 19
If you're really focused on very small servers with very little resource utilization. 20
So if you think about if you had 10 Web sites and they were all running an Apache daemon in a different 21
container then obviously you've got a lot more executable is running that's taking more ram and potentially 22
a little bit of wasted resources. 23
But if you're talking six to 10 you're not going to really gain anything if you were saying I need to 24
run a thousand Web sites and you have full control over all of them then you would have more significant 25
resource savings by putting those all in one container as one Apache and then essentially using different 26
Apache can figs for each Web site. 27
Right now that's very to me that's old school that's pre container. 28
I almost always would prefer isolating them in their own containers because that's easier to me. 29
I use will have one repo right for the code for that Web site and I'm going to put that repo into one 30
container image and there's that one to one relationship that makes sense to me. 31
You can also then scale those containers independently. 32
So if one needs to have three containers running for performance reasons or redundancy you can scale 33
that one independently of other containers and other Web sites. 34
Another reason if you need to update a Web site if you are doing the all in one container that means 35
now every web server has to restart just so that you can update that one container image whereas if 36
each one had its own container image and its own container then only the one that's changing would update. 37
Right. 38
So you would break potentially less you have less change overall. 39
So anyway that's just some of the good reasons to isolate and yeah the same reason goes for a lot of 40
other things like my sequel. 41
You know read this stuff like that. 42
Some people want to you know make everything into put everything on one huge Sequel Server and that's 43
fine. 44
That might make sense for you but there are also advantages to the isolation and the potential for updating 45
and stuff like that of breaking these things out. 46
So I think it's a little bit more fuzzy and not so black and white for databases because there is a 47
lot of efficiency when you talk about memory savings and stuff when you talk about building large scale 48
servers but when it comes to applications like web servers I always isolate them.