Effective use of multiple docker containers in one host

I have a physical server running Nginx, MySQL and serving my PHP site. The server has a multi-core processor with 16 GB of RAM. This server can handle a certain amount of web traffic.

Now instead of this separate server, if I run several docker containers that store separate instances of Nginx (App Server) and MySQL (DB Server) and load the balance between application and database containers, can it handle the same amount of traffic as and one server is being processed or will it be smaller (Performance wise)?

How will performance work if I use a virtual server, such as EC2 or Digital Ocean Leaflet, with the same hardware configuration as the physical server?

+6
source share
2 answers

Since the whole process starts on its own host (you can run ps aux on the external host container and see them). There should be very little overhead. The inputs of the network bridge and IP tables for forwarding packets to the virtual host will add some processor overhead, but I cannot imagine that this is too burdensome.

+3
source

If the question consists of several nginx + 1 mysql versus several containers with each nginx + mysql, it is probably better not to use containers from a performance point of view, mainly because mysql and how much memory it can have if it is one instance , and has several separate instances, you can in any case have nginx in separate containers, but use the same central mysql for all sites in the container or not.

+1
source

Source: https://habr.com/ru/post/976720/


All Articles