docker container for EdgeX services #74
Replies: 1 comment
-
At the end of the day, Docker is just running processes. Unlike virtualization, where the goal is to create an abstraction of some underlying hardware, containers partially virtualize the operating system, and it is done using highly efficient kernel namespace mechanisms to make each container think its processes are the only ones on the system. In reality, everything is running on the same kernel and executing on the same processor and communicating on the same kernel managed network bridge. The overhead of a container is minimal. By introducing an init system (https://wiki.gentoo.org/wiki/Comparison_of_init_systems) to run all the EdgeX processes instead of having Docker launch multiple containers, one now has to run an init system and also install the init system as part of the container. This takes space and memory that actually wasn't there before. Additionally, although most of the EdgeX services are in edgex-go, the device services all have their own repositories and build their own container. The proposed all-in-one model would mean that all components would have to be bundled, whether an adopter needed them or not for their scenario, which would waste more space. Also, if the container failed for some reason, it would take all of the services down all at once -- this behavior is antithetical to the goals of a microservice architecture. There is a case to be made for a single image that has all the components in it, that is spawned with different command line arguments to create multiple containers -- one service per container, all sharing a common image. This could, for example, speed up build time by eliminating redundant steps by building essentially a dozen similar containers. It could also reduce the overhead somewhat in pulling container images. But Docker optimizes the way it treats images, where common image layers are cached and re-used. It might look like a system has 1GB of images, but in a deeper analysis, 50 MB of that might be common across 10 images, and thus the actual space requirement might be more like 550MB. Bundling as a single image make make it look like a 550MB image instead of a 1GB image, but the reality might be that only 550MB of space was needed in the first place. You are free to package EdgeX any way you like, but as I explain above, you are unlikely to see any staggering improvements. What you are asking for is essentially the way that the EdgeX snap distribution does things. Perhaps you should look into using EdgeX snaps instead of docker? |
Beta Was this translation helpful? Give feedback.
-
Hi All ,
As we know that with Dockerization of EdgeX services, we can build individual containers for each services.
what if we put all the EdgeX services in 1 container? will this approach be beneficial in terms of running time, processing time , memory utilization of the system while running the Dockerized EdgeX ?
please let me know will it be a better approach and an efficient way to put all EdgeX service in 1 container and dockerize it instead of having multiple containers for each service ?
Thanks in advance .
Beta Was this translation helpful? Give feedback.
All reactions