In the midst of Docker’s meteoric rise and the explosion of talk around containers, it can be easy to lose oneself in all of the new terminology and jargon. While we think about the challenges presented by using containers in production, we also continue to hear the metaphor of Pets vs. Cattle and why it’s important to maintain an infrastructure that acts like a herd of cows.

Pets vs. Cattle

What is this pets vs. cattle nonsense we keep hearing? Simply put, the “cattle not pets” mantra suggests that work shouldn’t grind to a halt when a piece of infrastructure breaks, nor should it take a full team of people (or one specialized owner) to nurse it back to health. Unlike a pet that requires love, attention and more money than you ever wanted to spend, your infrastructure should be made up of components you can treat like cattle – self-sufficient, easily replaced and manageable by the hundreds or thousands. Unlike VMs or physical servers that require special attention, containers can be spun up, replicated, destroyed and managed with much greater flexibility.

A new(ish) set of challenges

Though containers aren’t a new technology, their ascent into the mainstream forces us to finally address the challenges presented by containers. Sticking with the livestock analogy, what if something starts preying on your herd? What if specific cows start consuming more than their fair share of resources, or if a group of cows suddenly disappear? And what if more cows join the herd? Will you have to brand each cow individually to keep track of them?

When its comes to using containers, a monitoring solution specifically built for containers is crucial to understanding what’s happening across your environment. While it’s possible to install a log-collecting agent on every container, a more efficient and scalable approach is to dedicate a custom container to focus explicitly on collecting container logs and stats. With a dedicated logging container that scales to capture data from all containers on a host as they’re added, you can correlate container stats with application logs and host logs for an end-to-end view of your environment.

Interested in learning more about optimizing your container environments and you can us container log monitoring to do it? Check out the infographic below!