Docker - separate nginx container for every separate my service container
up vote
1
down vote
favorite
Following Docker best practices - a container should be created with a "single responsibility" principle in mind - it makes a good idea to have nginx and some-my-custom service in separate docker containers. But the question is - if i run in an autoscaled/loadbalanced environment where i have at least 2-3 running copies of the same container - should I have a separate nginx container cluster for my every custom services cluster or should I have one nginx containers cluster for the whole infrastructure (but simply more instances). Please find an illustrated example.
Does it even make any difference?
docker nginx containers
add a comment |
up vote
1
down vote
favorite
Following Docker best practices - a container should be created with a "single responsibility" principle in mind - it makes a good idea to have nginx and some-my-custom service in separate docker containers. But the question is - if i run in an autoscaled/loadbalanced environment where i have at least 2-3 running copies of the same container - should I have a separate nginx container cluster for my every custom services cluster or should I have one nginx containers cluster for the whole infrastructure (but simply more instances). Please find an illustrated example.
Does it even make any difference?
docker nginx containers
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Following Docker best practices - a container should be created with a "single responsibility" principle in mind - it makes a good idea to have nginx and some-my-custom service in separate docker containers. But the question is - if i run in an autoscaled/loadbalanced environment where i have at least 2-3 running copies of the same container - should I have a separate nginx container cluster for my every custom services cluster or should I have one nginx containers cluster for the whole infrastructure (but simply more instances). Please find an illustrated example.
Does it even make any difference?
docker nginx containers
Following Docker best practices - a container should be created with a "single responsibility" principle in mind - it makes a good idea to have nginx and some-my-custom service in separate docker containers. But the question is - if i run in an autoscaled/loadbalanced environment where i have at least 2-3 running copies of the same container - should I have a separate nginx container cluster for my every custom services cluster or should I have one nginx containers cluster for the whole infrastructure (but simply more instances). Please find an illustrated example.
Does it even make any difference?
docker nginx containers
docker nginx containers
asked Nov 9 at 13:25
Laimonas Sutkus
378110
378110
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
I don't think there is an absolute answer to this question, so I'm just throwing my current (random) thoughts.
First, it depends on what you use nginx for. If it's used to host webpacked web site, then sure you need one nginx for each of your frontend
service, combined with worker_processes
in nginx.conf
, you have an easy load balancing solution for the frontend. If you want to use it a reverse proxy for load balancing, one instance is enough for a small cluster (when it grows bigger, you can add more to form a multi-tier load balancer).
Second swarm actually has a native load balancer that sort of works out of the box.
Third, the complexity of setting up nginx is also to be considered. Personally I don't think nginx is easy enough to setup and debug. Modern solutions like traefik.io are easier to use and built with clustering in mind, and come with extra features like automatic https configuration via lets'encrypt.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I don't think there is an absolute answer to this question, so I'm just throwing my current (random) thoughts.
First, it depends on what you use nginx for. If it's used to host webpacked web site, then sure you need one nginx for each of your frontend
service, combined with worker_processes
in nginx.conf
, you have an easy load balancing solution for the frontend. If you want to use it a reverse proxy for load balancing, one instance is enough for a small cluster (when it grows bigger, you can add more to form a multi-tier load balancer).
Second swarm actually has a native load balancer that sort of works out of the box.
Third, the complexity of setting up nginx is also to be considered. Personally I don't think nginx is easy enough to setup and debug. Modern solutions like traefik.io are easier to use and built with clustering in mind, and come with extra features like automatic https configuration via lets'encrypt.
add a comment |
up vote
1
down vote
I don't think there is an absolute answer to this question, so I'm just throwing my current (random) thoughts.
First, it depends on what you use nginx for. If it's used to host webpacked web site, then sure you need one nginx for each of your frontend
service, combined with worker_processes
in nginx.conf
, you have an easy load balancing solution for the frontend. If you want to use it a reverse proxy for load balancing, one instance is enough for a small cluster (when it grows bigger, you can add more to form a multi-tier load balancer).
Second swarm actually has a native load balancer that sort of works out of the box.
Third, the complexity of setting up nginx is also to be considered. Personally I don't think nginx is easy enough to setup and debug. Modern solutions like traefik.io are easier to use and built with clustering in mind, and come with extra features like automatic https configuration via lets'encrypt.
add a comment |
up vote
1
down vote
up vote
1
down vote
I don't think there is an absolute answer to this question, so I'm just throwing my current (random) thoughts.
First, it depends on what you use nginx for. If it's used to host webpacked web site, then sure you need one nginx for each of your frontend
service, combined with worker_processes
in nginx.conf
, you have an easy load balancing solution for the frontend. If you want to use it a reverse proxy for load balancing, one instance is enough for a small cluster (when it grows bigger, you can add more to form a multi-tier load balancer).
Second swarm actually has a native load balancer that sort of works out of the box.
Third, the complexity of setting up nginx is also to be considered. Personally I don't think nginx is easy enough to setup and debug. Modern solutions like traefik.io are easier to use and built with clustering in mind, and come with extra features like automatic https configuration via lets'encrypt.
I don't think there is an absolute answer to this question, so I'm just throwing my current (random) thoughts.
First, it depends on what you use nginx for. If it's used to host webpacked web site, then sure you need one nginx for each of your frontend
service, combined with worker_processes
in nginx.conf
, you have an easy load balancing solution for the frontend. If you want to use it a reverse proxy for load balancing, one instance is enough for a small cluster (when it grows bigger, you can add more to form a multi-tier load balancer).
Second swarm actually has a native load balancer that sort of works out of the box.
Third, the complexity of setting up nginx is also to be considered. Personally I don't think nginx is easy enough to setup and debug. Modern solutions like traefik.io are easier to use and built with clustering in mind, and come with extra features like automatic https configuration via lets'encrypt.
answered Nov 9 at 15:46
Siyu
1,041617
1,041617
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53226575%2fdocker-separate-nginx-container-for-every-separate-my-service-container%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown