Is containerization of software applications eco-friendly?
This question was a side-effect of an interesting conversation with my friend.
I got a call from my friend who asked me to help him find a light but spacious suitcase to carry some essential luggage for a vacation.
I got curious and asked him what he wanted to carry. He replied he wanted to take some packs of diapers, some bags of crisps, a bottle of honey, a small wi-fi router, etc. The annoyance is that the suitcase he has right now is much heavier than the total weight of all the items. There is no point in carrying such a heavy suitcase for such a light payload, especially when the airline charges for the luggage.
My immediate but sarcastic response was, "Why that baggage? Why can't you buy all the stuff at the destination? The things that you want to pack are available everywhere. The Wi-fi router is as unnecessary as the other things! I get that these things give convenience and comfort, but won't travel without baggage be more comfortable?"
A moment later, I asked myself, "Should I have responded with the same sarcasm to the Tech lead who had been loudly touting containerization as the de-facto solution for the future since his return from the cloud guys conference?"
Is software application containerization any different from packing baggage in a stylish suitcase?
Can software containerization be harmful to the environment just the way unnecessary baggage is?
Now that I have this burning question, I wanted to find out the answer through an experiment on some of the top container technologies!
The results of my test were astonishing. I used a laptop computer with 16GB of memory and 4 CPU cores for these experiments -?
领英推荐
The laptop could run several thousands of threads of a program silently, but for barely ten containers, it heated up like an iron box and sounded like a vacuum cleaner!
I could test 100 microservices when configured with regular routing, service discovery and load balancer. The popular container tool with the side-car and ingress controller made the laptop touch 100% CPU utilization for only four microservices.
With the plain old chroot command, I could spin up fifteen full-fledged web applications, each with its database and little noise from the CPU fan. However, the container software could manage to run only two applications before the laptop became unbearably hot and eerily noisy!
Though it is undeniable that the container software tools provided convenience, the experiments made me wonder if containerization is indeed the bright future.
The tech leads who vociferously advocate containers might have concluded with this sequence of questions -??
Reversing the sequence of these questions may lead to a different conclusion.
Containerization is undoubtedly better than virtual machines or physical hardware units. It offers a lightweight suitcase for carrying the dependencies and configuration required by the software application.
A lightweight suitcase is more convenient than a heavier one.
But why baggage?
Software Architect
2 年containers are also good to deploy code without having side affects of a secific env. meaing it works on my ubuntu 20.04 but not in 22.04 ... but if there is big over head of power, i would look in to just making sure that use the correct iamge and run many services on that. i prefer a combinaiton of microservices and smaller webapps to solve problems. i see the great uses of microservices but they have their headaches too. so a middle ground is best, with good processes like reviews and such
administrator at ignou
2 年Though per se I have no expertise to comment on the discourse, but this thought provoking one examplified in the easy to understand words, I feel should give rise to many young kindled minds explore very future technology towards not only eco-friendly but making Globe much Smaller in terms of ease and pace of information flow and utilisation. Great thoughts Dear Srinivas Gopinath
Enabling Digital Transformation across the enterprise via process and technology disruptions.
2 年Excellent points Srinivas! Having grown up meticulously managing memory allocation on the heap using malloc and dealloc and using semaphores to manage concurrency, I must admit that containers feel like an overkill to guard against poor programming practices. But you seem to have missed out on the need for declarative security that containers have to offer. So while your code might not have any malicious intent, you need to guard against other pieces of code being executed on the same compute resource. This is where the overhead of the container runtime is an acceptable compromise. Maybe, overtime the OS will be codified in to the hardware (in the form of a SoC) and container based virtualisation will be as efficient as the hyper visor running on bare metal. Until then please do keep your laptop adequately cooled!